SetDocumentation Index
Fetch the complete documentation index at: https://docs.cogito.decart.ai/llms.txt
Use this file to discover all available pages before exploring further.
stream: true to receive an OpenAI-compatible Server-Sent Events stream of chat completion chunks.
Chunk shape
Eachdata: line carries one JSON object with the same structure as a non-streaming response, but with delta instead of message:
delta.role: "assistant". The final chunk has finish_reason: "stop" (or length, tool_calls, content_filter). The stream ends with the literal sentinel:
Cancellation
Closing the connection cancels generation server-side and stops billing immediately. We don’t charge you for tokens you cancelled before they arrived.Error recovery
Network blips during a stream show up as truncated SSE — the connection drops without a[DONE] sentinel. The OpenAI SDK throws on this. On retry, replay your full message history; chunks already received are not retained server-side.
Every response (streamed or not) includes an x-request-id header. Log it. When you open a support ticket we trace through the entire stack from that single ID.