openai · OpenAI Platform Docs
Streaming API responses
How to implement server-sent events (SSE) by setting the stream parameter to true and handling typed semantic events to process model outputs incrementally.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Streaming API responses
How to implement server-sent events (SSE) by setting the stream parameter to true and handling typed semantic events to process model outputs incrementally.
When To Use
Use when you need to implement real-time text rendering or incremental processing of model outputs to reduce perceived latency in an application.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/streaming-api-responses-workflow-guide.md | A guide explaining how to enable and handle real-time streaming responses from the OpenAI API to reduce perceived latency. | Questions about a guide explaining how to enable and handle real-time streaming responses from the OpenAI API to reduce perceived lat... |
examples/streaming-api-responses-openai-streaming-api-python-event-types.python | A Python implementation demonstrating the various event types used when streaming API responses. | Exact payloads, commands, or snippets shown in A Python implementation demonstrating the various event types used when streaming API responses. |
examples/streaming-api-responses-openai-streaming-api-response-object-structure.text | A text representation of the fields and structure found in an OpenAI streaming API response object. | Exact payloads, commands, or snippets shown in A text representation of the fields and structure found in an OpenAI streaming API response object. |
What This Skill Covers
- By default, when you make a request to the OpenAI API, we generate the model's entire output before sending it back in a single HTTP response. When generatin...
- Main sections:
Enable streaming,Read the responses,Advanced use cases,Moderation risk.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/streaming-responses.md
