Skip to main content
Streaming lets you display partial responses in real time instead of waiting for the full completion. Set stream: true in your request.

Example

How it works

When streaming is enabled, the API returns a series of server-sent events (SSE). Each event contains a JSON chunk with a delta object holding the next piece of content.
The final data: [DONE] message signals the end of the stream. The last chunk before it includes a usage field with token counts.