Local HTTP API
Call Coaade Manager's loopback API from your own tools to chat with local models, list and switch models, and control the runtime.
While Coaade Manager is running, it serves an HTTP API on your own machine. The CLI and the VS Code extension use it, and so can your scripts and tools. Requests never leave your computer.
Basics
| Base URL | http://127.0.0.1:11434/v1 |
| Listens on | Loopback only (127.0.0.1). It isn't reachable from other machines. |
| Authentication | A Coaade API key in X-Api-Key: <key> or Authorization: Bearer <key> |
| Format | JSON. POST /v1/chat streams Server-Sent Events. |
Create a key on the API Keys page. Requests without a valid key are rejected.
export COAADE_KEY="coaade_sk_..."
curl -s http://127.0.0.1:11434/v1/status -H "X-Api-Key: $COAADE_KEY"Get status
/v1/statusAPI keyThe runtime's state, the active model, your cached plan and usage, and the Manager version.
{
"runtime": { "status": "running", "port": 39281, "activeModelId": "coaade-code", "pid": 41822 },
"subscription": { "tier": "pro", "messagesUsed": 120, "messagesLimit": 999999 },
"activeModel": "coaade-code",
"version": "0.2.0"
}Chat (streaming)
/v1/chatAPI keySend a conversation to the active local model and stream the reply as Server-Sent Events.
Prop
Type
context accepts:
Prop
Type
curl -N http://127.0.0.1:11434/v1/chat \
-H "X-Api-Key: $COAADE_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [{ "role": "user", "content": "Explain what this function does" }],
"context": {
"language": "Python",
"files": [{ "path": "app.py", "content": "def add(a, b):\n return a + b" }]
}
}'Each event's data is a JSON object with a type:
type | Fields | Meaning |
|---|---|---|
status | message | Progress, such as "Processing request..." |
token | content | The next piece of the reply. Concatenate them. |
done | usage.completionTokens | The reply is complete. |
error | message | Something failed, for example the runtime isn't running. |
data: {"type":"status","message":"Processing request..."}
data: {"type":"token","content":"This "}
data: {"type":"token","content":"function adds two numbers."}
data: {"type":"done","usage":{"promptTokens":0,"completionTokens":7}}Manager adds the instructions of a matching installed extension automatically.
Chat with tools
/v1/chat/toolsAPI keyA non-streaming chat completion with tool definitions, used by agentic clients such as the CLI.
Prop
Type
The response is the completion object, with a choices array. If the runtime isn't running, the response has an error string and an empty choices array.
List models
/v1/modelsAPI keyInstalled models and which one is active.
[
{ "id": "coaade-code", "name": "Coaade Code", "active": true, "sizeBytes": 392167424, "quantization": "Q4_K_M" }
]Switch the active model
/v1/models/switchAPI keyMake an installed model the active one.
curl -s http://127.0.0.1:11434/v1/models/switch \
-H "X-Api-Key: $COAADE_KEY" -H "Content-Type: application/json" \
-d '{ "modelId": "coaade-code" }'{ "success": true, "activeModelId": "coaade-code" }If the model isn't installed: { "success": false, "error": "Model not found" }.
Start and stop the runtime
/v1/runtime/startAPI keyStart the local engine with the active model. Waits up to 30 seconds for it to be ready.
/v1/runtime/stopAPI keyStop the local engine.
| Response | Meaning |
|---|---|
{ "status": "running", "pid": 41822, "port": 39281 } | Started |
{ "status": "stopped", "message": "Runtime stopped" } | Stopped |
{ "status": "error", "message": "…" } | It couldn't start, for example it wasn't ready within 30 seconds |
List extensions
/v1/skillsAPI keyInstalled skill packs.
[{ "id": "react", "name": "React", "keywords": ["react", "jsx", "hooks"], "localPath": "/Users/you/.coaade/skills/react" }]The example IDs, ports and sizes on this page are illustrative. The engine port is chosen by Manager; read it from
GET /v1/status.