Chat
Answer in one piece as JSON.
/api/v1/chatTakes 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–100requiredThe full history in order. Each message has a role (system | user | assistant) and content (1–32000 characters).
modelstring | nullAn id from GET /models. null = default from the backend configuration.
temperaturenumber | null · 0–2Creativity. Lower = more predictable. null = default.
max_tokensinteger | null · 1–32000Upper bound on answer length incl. thinking tokens. null = default.
top_pnumber | null · >0–1Nucleus sampling. null = default.
voice_idstring | nullFor read_aloud: the ElevenLabs voice to speak with. null = the configured default. The model never picks this — the caller does.
tts_modelstring | nullFor read_aloud: an id from GET /tts/models. null = the configured default.
Example request
{
"messages": [
{ "role": "system", "content": "You are concise and precise." },
{ "role": "user", "content": "Explain SSE in two sentences." }
],
"temperature": 0.7,
"max_tokens": 500
}Response
{
"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.
200Answer generated.
422Invalid body or parameter.
429Provider quota exhausted.