Skip to main content
Receive a model’s response as it is generated instead of waiting for the entire answer.
Streaming displays the model’s response progressively as the model generates it, allowing you to start reading before the complete answer is ready. Without streaming enabled, you see nothing while the model generates its answer. After generation finishes, the complete answer appears at once. Both approaches can generate the same answer—the key difference is in how the response is delivered to your application and displayed. Streaming is useful in cases where users benefit from seeing the response immediately.

Enabling streaming

Deploy supports streaming responses via Server-Sent Events (SSE). By default, stream: false. Set stream: true in your request to enable it.

Response format

The response is a stream of Server-Sent Events, each an OpenAI-style chat.completion.chunk. Content arrives incrementally in choices[0].delta.content:
The stream includes a final usage chunk with an empty choices array and populated usage field. This is followed by data: [DONE] , marking the end of the stream.