Streaming
Streaming is a way of delivering AI output in which a large language model (LLM) sends its answer piece by piece as it is generated, instead of waiting until the whole response is finished. By default, the OpenAI API generates the entire output before returning it in one HTTP response; with streaming, the application can start showing or processing the beginning while the rest is still being written.[1] Both OpenAI and Anthropic deliver text streams as server-sent events (SSE).[1][2]
What does Streaming mean in simple terms?
Without streaming, you ask a chatbot a question and stare at a blank screen until the full answer arrives. With streaming, words can start appearing before the full answer is ready and the answer fills in line by line, much like watching someone type in a messaging app. The model does not write any faster; what changes is how soon you see the first words. OpenAI calls streaming the single most effective way to make users wait less, describing waiting times of a second or less as an illustrative benefit, rather than a guaranteed latency, and notes that users also finish reading sooner.[5] This is useful for chat assistants, coding assistants and voice interfaces.
How can Streaming be explained with an analogy?
Instead of finishing a whole report and submitting it for approval at once, you share each paragraph with your manager as soon as you write it.
Where is Streaming used?
OpenAI API — Streaming as the standard chat experience
In the OpenAI API, setting stream=true returns the response as server-sent events.[1] With the Responses API, the client listens for events such as response.created, response.output_text.delta and response.completed; with Chat Completions, each chunk carries new text in a delta field.[1] OpenAI's latency guide recommends streaming first when you want users to see progress instead of waiting.[5]
Result: Users can see and read partial text before the full answer is complete; the time to first output depends on the model, request, and network.[5]
NAVER CLOVA Speech — Real-time speech-to-text
NAVER Cloud Platform's CLOVA Speech real-time streaming API takes 16 kHz, single-channel, 16-bit PCM audio and converts it to text while the speaker is still talking.[6] It is available only over gRPC, with audio sent as a stream and recognition results returned as a stream; Korean, English and Japanese can be set as recognition languages.[6] Results are cut into segments based on settings such as silence length, duration or punctuation, and each segment includes its position so the application can assemble the full transcript.[6] This suits live captions, meeting notes and call-center agent screens. The streaming API is not offered on the free plan.[6]
Result: Captions can build up while people are still speaking, instead of after the whole recording is uploaded.[6]
Anthropic Messages API — Showing an agent's progress
When "stream": true is set, the Anthropic Messages API first sends message_start with an empty message, then sends each content block as content_block_start, one or more content_block_delta events and content_block_stop, and ends with message_delta and message_stop.[2] Text, tool inputs and thinking each arrive as their own delta types, and ping and error events can appear in the stream.[2] Coding and research agents can use these events to show users what step the agent is on.
Result: Tool calls and reasoning summaries can be shown as they happen, rather than only after the final answer.[2]
OpenAI Realtime API — Two-way voice streaming
The OpenAI Realtime API streams audio and events in both directions. A session connects over WebRTC in the browser or over WebSocket on the server, and it handles audio turns, tool calls and user interruptions.[8] For browsers and mobile apps, OpenAI recommends WebRTC rather than WebSocket for more consistent performance.[7] OpenAI's voice agent guide also describes a chained pipeline (speech-to-text, agent, text-to-speech) for teams that need to inspect each stage, and suggests measuring audible response latency and interruptions when evaluating a voice agent.[9] Restaurant booking lines and first-line call-center support are typical places to consider this design.
Result: Users can speak and interrupt naturally, and the team can measure response delay as part of testing.[8][9]
Try it today
- Add
stream=true(OpenAI) or"stream": true(Anthropic) to your chatbot call and measure the time to the first token in milliseconds.[1][2] - On the front end, read events using the provider SDK or a
fetchReadableStream, or useEventSourcefor a compatible application-owned SSE endpoint and append text deltas to the screen as they arrive. Keep provider API credentials on the server.[1][4] - Add a Stop button and check in your usage logs how output tokens are counted when a user stops a stream partway.
- Deliberately cut the network or trigger a timeout mid-stream to test error handling, reconnection and how a partial answer is shown.[2][3]
- For structured output such as JSON or tool arguments, collect the full content before parsing it with a proper JSON parser. Anthropic, for example, sends tool input as partial JSON strings to be parsed once
content_block_stoparrives.[2]
Limits and direction
Streaming mainly changes how long users wait to see output; it does not make the model generate any faster.[5] Partial output also makes moderation harder: OpenAI notes that partial completions are more difficult to evaluate, and that moderation scores requested with a generation arrive only after the full output is ready.[1] If the connection breaks, the client has to track what it has already received. Anthropic recommends saving the partial response and sending a continuation request, and notes that tool use and thinking blocks cannot be partially recovered.[2]
The transport layer has its own issues. Without HTTP/2, browsers allow only about six SSE connections per domain across all tabs.[4] Some legacy proxy servers drop idle HTTP connections, which is why the SSE specification suggests sending a comment line about every 15 seconds, and chunking or buffering by intermediate layers can delay event delivery.[3] In production, plan for keep-alive events, retries and monitoring of cumulative token usage, which Anthropic reports in the message_delta event.[2]
Two directions stand out. First, real-time streaming is moving beyond text to two-way voice: OpenAI's Realtime API uses WebRTC for client connections and handles interruptions inside the session, and OpenAI also offers a full-duplex voice option that can listen and speak at the same time.[7][8][9] Second, speech LLMs are reducing the need for separate speech recognition and synthesis modules. NAVER describes Speech X, built on HyperCLOVA X, as a single model that handles speech understanding and natural speech output.[10]
Which concepts are related to Streaming?
- Related conceptPrompt VersionOften appears alongside streaming in the prompts and AI usage group.
- Related conceptPrompt LibraryOften appears alongside streaming in the prompts and AI usage group.
- Related conceptPersona PromptingOften appears alongside streaming in the prompts and AI usage group.
Which sources explain Streaming?
- OpenAI — Streaming API responses (accessed 2026-10-13) — https://platform.openai.com/docs/guides/streaming-responses
- Anthropic — Streaming messages, Claude Platform Docs (accessed 2026-10-13) — https://platform.claude.com/docs/en/build-with-claude/streaming
- WHATWG — HTML Living Standard §9.2 Server-sent events (last updated 2026-10-12) — https://html.spec.whatwg.org/multipage/server-sent-events.html
- MDN Web Docs — EventSource (last modified 2025-03-13) — https://developer.mozilla.org/en-US/docs/Web/API/EventSource
- OpenAI — Latency optimization (accessed 2026-10-13) — https://developers.openai.com/api/docs/guides/latency-optimization
- NAVER Cloud Platform — CLOVA Speech real-time streaming recognition (accessed 2026-10-13) — https://api.ncloud-docs.com/docs/ai-application-service-clovaspeech-grpc
- OpenAI — Realtime API with WebRTC (accessed 2026-10-13) — https://developers.openai.com/api/docs/guides/realtime-webrtc
- OpenAI — Getting started with the Realtime API (accessed 2026-10-13) — https://developers.openai.com/api/docs/guides/realtime
- OpenAI — Voice agents (accessed 2026-10-13) — https://developers.openai.com/api/docs/guides/voice-agents
- NAVER CLOVA Tech Blog — HyperCLOVA X-based speech synthesis (AudioLLM) (2024-08-07) — https://clova.ai/tech-blog/ko-hyperclova-%EA%B8%B0%EB%B0%98-%EC%9D%8C%EC%84%B1-%ED%95%A9%EC%84%B1-%EA%B8%B0%EC%88%A0-audiollm
Tell us what you think
Your feedback helps us improve the content.