Skip to Content
coaadedocs

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 URLhttp://127.0.0.1:11434/v1
Listens onLoopback only (127.0.0.1). It isn't reachable from other machines.
AuthenticationA Coaade API key in X-Api-Key: <key> or Authorization: Bearer <key>
FormatJSON. 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

GET/v1/statusAPI key

The 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)

POST/v1/chatAPI key

Send 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:

typeFieldsMeaning
statusmessageProgress, such as "Processing request..."
tokencontentThe next piece of the reply. Concatenate them.
doneusage.completionTokensThe reply is complete.
errormessageSomething 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

POST/v1/chat/toolsAPI key

A 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

GET/v1/modelsAPI key

Installed models and which one is active.

[
  { "id": "coaade-code", "name": "Coaade Code", "active": true, "sizeBytes": 392167424, "quantization": "Q4_K_M" }
]

Switch the active model

POST/v1/models/switchAPI key

Make 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

POST/v1/runtime/startAPI key

Start the local engine with the active model. Waits up to 30 seconds for it to be ready.

POST/v1/runtime/stopAPI key

Stop the local engine.

ResponseMeaning
{ "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

GET/v1/skillsAPI key

Installed 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.

On this page