Skip to main content
Set stream: true to receive a Server-Sent Events response from POST /v1/chat/completions.

Stream a response

Set stream_options.include_usage to true when your client needs the usage-only chunk.

Event shape

The response uses these headers:
Content arrives in OpenAI-compatible data: events. Read partial output from choices[].delta.
When client-visible usage is enabled, the usage event has an empty choices array:
The gateway forwards data: [DONE] when the upstream stream sends it.

Is usage always included?

No. The gateway always requests usage from the hosted model so it can settle the request. It forwards the usage-only event to your client only when your original request includes:
If you omit that option, content chunks still stream, but the usage-only chunk is hidden from your client. If the upstream stream omits usage, the gateway does not synthesize a client-visible usage chunk.
Streaming requests do not use the chat idempotency cache. See Idempotent retries before retrying a stream.