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–1000requiredThe full history in order. Each message has a role (system | user | assistant) and content (up to 400000 characters). User messages may include attachment_ids, an array of uploaded file IDs within UPLOADS_MAX_FILES.
chat_idstring | null · up to 64 charactersRequired with attachment_ids. Identifies the conversation that owns the uploaded files and working directory.
toolsboolean · default trueEnable available tools. Reading, unpacking and editing attachments requires true.
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.