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 final chunk carries a usage object with token counts. Billing settles on actual usage after the stream completes.
NextStructured outputs →