Chat — trigger a streaming turn
POST /v1/chat/stream — Starts an agent turn and returns immediately with the session id. The turn runs in the background; its events (LLM delta
POST /v1/chat/stream
Starts an agent turn and returns immediately with the session id. The turn runs in the background; its events (LLM delta, tool call, tool result, final assistant message) stream over the multiplexed WebSocket at /v1/stream on the chat channel keyed by the returned session_id. A reconnect resumes from the per-session sequence buffer.
| Method | POST |
| Path | /v1/chat/stream |
| Auth | Authorization: Bearer <token> required by default (configured or generated token); optional only in explicit loopback development mode (MINARA_ALLOW_INSECURE_BIND=1, with GATEWAY_AUTH_TOKEN unset) |
| Category | chat |
Request body
{ "message": "analyze BTC momentum", "session_id": "chat_...", "attachments": [ { "key": "file_ab12", "filename": "chart.png", "media_type": "image/png", "size": 48213, "kind": "image" } ], "model": "claude-sonnet-4-5", "reasoning_effort": "high" }Response body
{ "session_id": "chat_...", "kind": "chat", "is_new": true }Notes
New tasks require message. Setup continuations (capability_continuation, its legacy alias connector_continuation, or mcp_continuation) and failure recovery requests may omit it. session_id selects an existing conversation; omit it to create a session (session_kind defaults to chat).
Failure recovery: use the server's recovery decision and recovery_target from the error event or saved error metadata. For resume, send only { session_id, resume: true, resume_target: recovery_target }. The server restores the original task settings and execution cursor, then rebuilds model input from durable history through the shared execution pipeline, preserving completed tool results without adding a user message. For restart, send only { session_id, restart_target: recovery_target }. This starts the original task again using the server-recorded model switch and is offered only if no work was committed. Both actions ignore composer fields and preserve the original modes. unavailable does not authorize either action. Stale targets, incompatible checkpoints and unsafe restarts return 409.
Message identity and one-shot skills — client_message_id is a nonblank client-generated string (maximum 200 characters), persisted with the user message. For retry: true, send retry_target with the original message's client_message_id (or legacy u-<row id>). Only a matching latest durable user turn is retracted; an unsaved or superseded target leaves previous history intact. Omitting retry_target retains legacy latest-turn replacement. turn_skill_overrides: { include: string[], exclude: string[] } applies only to this message and is persisted as skill_overrides in its metadata. It does not change session defaults. To retry with the same skills, send the original message's overrides again; a later ordinary message does not inherit them.
capability_continuation: { "tool_call_id": "..." } requires an existing session_id and a resumable capability requirement in a tool result from the latest settled turn. The capability must be installed and ready for the requested services. The continuation preserves chat history and tool results and the original Plan/Deep mode without adding a visible user row. Incomplete setup, duplicate callbacks, interrupted tasks and superseded tasks return 409. Do not combine it with retry: true, resume: true, a parent session or a Plan approval continuation. connector_continuation is a legacy alias using the same capability checks; send only one continuation field.
Attachments — two-step flow: upload bytes via POST /v1/files (multipart) to get a key, then reference it here. Each entry is { key, filename, media_type, size, kind } with kind one of "image" | "pdf" | "spreadsheet" | "text" | "office" (generic "file" is rejected — not readable by the agent yet). Limits: at most 8 attachments per turn, 5 MiB per image, 20 MiB per other file. Voice input rides a parallel field: voice_input_key carries the FileStore key of the original mic recording (uploaded via POST /v1/voice/transcribe?persist) so history can replay the audio; the transcript itself goes in message.
Per-turn model override — model runs THIS turn on the given model id without touching the deployment default (PUT /v1/llm/default-model), so concurrent clients don't affect each other. The id must be served by the active provider connection (see GET /v1/llm/available-models); a model that would require switching the connection is rejected with 400. reasoning_effort overrides the thinking tier for this turn and must be a tier the effective model supports. Bad values 400 before the turn starts.
Mid-turn steering: a user_interjection event is emitted on the WS chat channel when a message queued via POST /v1/chat/interject is injected into the running turn. The final done event carries two optional fields: interrupted: true when the turn was stopped via POST /v1/chat/interrupt, and pending_interjections: string[] listing interjected messages that arrived too late to inject; clients re-send those as normal messages. Prompt variant selection for headless callers: the optional body fields surface ("web" | "cli", default "web") and prompt_mode ("full" | "minimal", default "full") tune the system prompt — cli omits the custom-URI wire protocol, minimal mounts the lean skeleton (identity + skill/tool mechanics + base markdown) and strips personalization from the injected context while keeping the skill catalog, date, and working directory. The WebSocket wire protocol (channels, subscribe/unsubscribe frames, seq, replay, control frames) is documented on the Streaming — the multiplexed WebSocket page.