Home › Learn › AI Agents
AI Agents

What is Streaming?

Receiving a model's output token by token as it's generated, instead of waiting for the whole response — how you get that typing effect.

How it works

Streaming improves perceived speed for user-facing apps and lets you show progress on long generations. It doesn't change the tokens or cost, just how they arrive — but it complicates agent loops, which need the complete structured response before acting.

Example

In practiceA chat app streams the answer so the user sees it form in real time; the agent loop waits for the full tool_use block before executing.

Should agents stream?

Stream to the user for responsiveness, but buffer the full response when the agent needs to parse tool calls or structured output.

Go deeper: Deploy Your First AI Agent

The complete, step-by-step guide — every command, config, and the reasoning behind it.

Get the guide