Tutorials · Chapter D (4/4) · ~9 min
Streaming responses
Try it → see it → read → next
Show tokens as they arrive — `stream=true` for snappier chat UX.
Try yourself
Playground
Streaming tokens
Stream shows tokens as they arrive — better UX for long replies.
Assistant
Recap
What you just did
You watched tokens arrive one chunk at a time — time-to-first-token matters.
Teach
How it works
Use it
When you'd use this
- Chat UIs, long summaries, code generation
- Anywhere users would otherwise stare at a spinner
Watch out
Watch out
Harder to log complete replies until stream finishes. Handle disconnects and timeouts.
Try next
Try this next
How-to: call OpenAI with streaming