Search the documentation

Pick a page and open it with Enter.

Chat

Answer in one piece as JSON.

POST/api/v1/chat

Takes the full history and produces the next answer in one piece. Tools run internally in the agent loop — this response shows only the final result; the intermediate steps are visible only in the stream.

Parameters

messagesMessage[] · 1–100required

The full history in order. Each message has a role (system | user | assistant) and content (1–32000 characters).

modelstring | null

An id from GET /models. null = default from the backend configuration.

temperaturenumber | null · 0–2

Creativity. Lower = more predictable. null = default.

max_tokensinteger | null · 1–32000

Upper bound on answer length incl. thinking tokens. null = default.

top_pnumber | null · >0–1

Nucleus sampling. null = default.

voice_idstring | null

For read_aloud: the ElevenLabs voice to speak with. null = the configured default. The model never picks this — the caller does.

tts_modelstring | null

For read_aloud: an id from GET /tts/models. null = the configured default.

Example request

json
{
  "messages": [
    { "role": "system", "content": "You are concise and precise." },
    { "role": "user", "content": "Explain SSE in two sentences." }
  ],
  "temperature": 0.7,
  "max_tokens": 500
}

Response

json
{
  "content": "Server-Sent Events are a one-way channel over which the server continuously pushes text to the browser across an open HTTP connection. Unlike WebSockets, it is purely server-side and runs over ordinary HTTP.",
  "model": "deepseek-v4-flash",
  "finish_reason": "stop",
  "reasoning": "The user wants a short explanation …",
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 58,
    "total_tokens": 100,
    "reasoning_tokens": 20
  }
}

reasoning is only filled on reasoning models, otherwise null. usage can be null if the provider returns nothing.

200

Answer generated.

422

Invalid body or parameter.

429

Provider quota exhausted.