Skip to main content
Setting the stream option to true returns the model’s response incrementally as a stream of chunks, so you can display results as they arrive instead of waiting for the entire response. This is helpful when models take time to generate output. All hosted models support streaming output. We recommend streaming for reasoning models, since non-streaming requests can time out if the model takes a long time to start producing output. The following examples enable streaming for a chat completion request:
Chunks that carry generated text have entries in choices. The last chunk of every stream has an empty choices array and a usage object with prompt_tokens, completion_tokens, and total_tokens.
Last modified on November 25, 2026