Streaming chat¶
Set stream to true on a Chat Completions request when the application must receive generated content incrementally. Parse the Server-Sent Events in the order received and assemble only the text deltas defined by the Chat Completions event shape.
Keep the request ID, model ID, and redacted error details if the stream ends unexpectedly. Do not apply Chat Completions event handling to Responses or Anthropic Messages streams; those interfaces use different event formats.
Last updated on