CORE
Streaming
Set stream: true to receive the reply token-by-token as OpenAI-compatible server-sent events (SSE).
How it works
Each event is a data: {...} line carrying a chat.completion.chunk. The stream ends with data: [DONE]. Reasoning-model tokens arrive in delta.reasoning_content.
i
Failover is only possible before the first byte. Once the first event reaches the client the response is committed to the current route, and a later error surfaces in-stream as an error event.
Usage & tokens
The last chunk before [DONE] has empty choices and a usage object: token counts plus cost, what the request took from the balance (USD). It is always sent - no need for stream_options.include_usage. Billing settles on actual usage right after the stream completes.
NextStructured outputs →