promptgarten ๐ŸŒฑ
๐ŸŒ ES
Termโ—โ—‹โ—‹3 min ยท +20 XP

Streaming: Why Answers Appear Word by Word

When a chat or CLI shows you an answer typing itself out live, that's streaming - the model sending its response one small piece at a time instead of making you wait for the whole thing.

What streaming actually is

Instead of waiting for the model to finish an entire response and then sending it back all at once, streaming sends the output incrementally - piece by piece, as it's generated - so you see text appear progressively rather than waiting in silence and getting a wall of text at the end.

Why tools stream at all

Two reasons, both about perceived experience rather than actual quality: it feels faster, because you start reading immediately instead of staring at a spinner, and it lets you abort early. If the first sentence already tells you the answer is going the wrong direction, you can stop the request instead of waiting for tokens you don't need.

The mechanism: server-sent events

Streaming APIs typically use server-sent events (SSE), a simple one-way protocol where the server pushes a sequence of small messages over one open connection, and the client processes each one as it arrives. Both Claude's and OpenAI's APIs use SSE for streaming responses.

What streaming doesn't change

The model doesn't "think differently" when streaming is on - it's the exact same generation process, same quality, same cost per token. Streaming is purely about delivery: whether you get the response in one lump at the end, or in a running trickle as it's produced.

EXAMPLE

Simplified SSE event stream for the word "Hi there": event: content_block_start data: {"type":"content_block_start","index":0} event: content_block_delta data: {"delta":{"text":"Hi"}} event: content_block_delta data: {"delta":{"text":" there"}} event: content_block_stop data: {"index":0} event: message_stop

๐Ÿ› ๏ธ EXERCISE โ€” TRY IT YOURSELF

Observe the difference between a streamed and a non-streamed response to the same prompt.

  1. Pick a prompt that produces a fairly long answer (a few paragraphs).
  2. If you have API access, send it once with streaming enabled and once with it disabled, and time both from request to first visible output.
  3. If you don't have API access, compare a chat UI (which streams) against copy-pasting the same prompt somewhere that shows the full answer at once.
  4. Note the time-to-first-token in the streamed version versus the wait time in the non-streamed version.
  5. Confirm the final text content is identical either way - only the delivery differs.

โœ… SELF-CHECK

  • โ˜ Was the time-to-first-token noticeably shorter with streaming than the total wait for the non-streamed version?
  • โ˜ Was the final answer text the same in both cases?

QUICK QUIZ

Does turning streaming on change the model's answer quality or the total time it takes to generate a response?

Share:๐•in๐Ÿ’ฌ

SOURCES

RELATED TOPICS

What Is an API? (Explained Without Jargon) โ—โ—‹โ—‹Rate Limits and Quotas: Why AI Tools Sometimes Say Slow Down โ—โ—‹โ—‹Cost Control for AI Agents โ—โ—โ—‹Headless Mode: Running Agents Without Interaction โ—โ—โ—‹