EP16 · April 6, 2026 · 7:59 · AI Dev Tools: The Crazyrouter Podcast

Streaming vs Non-Streaming API Calls — Performance Deep Dive

Streaming and non-streaming LLM calls take about the same total time and cost the same per token, but they feel very different to users and behave differently in production. This episode explains time to first token and perceived latency, when streaming is the right choice, when a single complete response is simpler and safer, and practical tips for timeouts, errors and hybrid setups.

Key takeaways

  • Stream any response a person is watching, such as chat interfaces and long-form generation, so text appears within moments instead of after a spinner.
  • Use non-streaming calls for backend pipelines, batch jobs and chained calls where no human is waiting.
  • Prefer non-streaming when you need complete JSON or function-call output to parse, rather than buffering a stream yourself.
  • Expect the same token bill either way; differences come from infrastructure (open connections) and from users cancelling unwanted streamed answers early.
  • Give streaming calls both a connection timeout and a between-chunk timeout, and build retry logic for streams that drop mid-response.
  • Benchmark each model in both modes, because time to first token varies noticeably between models.

Show notes

What changes when you stream#

In a standard non-streaming call, you send a prompt, the model generates the entire response, and it arrives as one payload. One request, one response.

In a streaming call, the request is identical but the answer arrives in small chunks as the model produces them, typically over Server-Sent Events (SSE). Your application receives a continuous flow of data and can display each piece immediately, appending it to what the user already sees. The client has to read the stream incrementally and assemble the final text itself, which is the main extra work streaming adds.

A useful analogy: non-streaming is takeout, where you wait and everything arrives at once. Streaming is a sushi conveyor belt, where pieces show up as soon as they are ready. In OpenAI-compatible APIs, including gateways such as Crazyrouter, switching between the two is a single request parameter: set stream to true or false.

Time to first token and perceived latency#

The model still generates every token either way, so total generation time is roughly the same. What differs is how that time is experienced.

Time to first token (TTFT) measures how quickly the user sees the start of the answer. With streaming, that can be a fraction of a second. Without it, the user waits through the entire generation, which can stretch to many seconds for longer outputs.

Perceived latency is the psychological side. Text that appears word by word feels fast and responsive even when the total duration is identical, which is why progressive output consistently feels quicker than a spinner followed by a wall of text.

These two metrics are why the choice matters most for user-facing features. When nobody is watching the output arrive, TTFT and perceived latency stop mattering, and the decision comes down to simplicity and reliability instead.

When streaming is the right choice#

  • Chatbots and conversational UIs. Whenever a person is watching the screen, streaming is dramatically better. It is why ChatGPT, Claude and the other major AI chat interfaces stream by default.
  • Real-time dashboards and monitoring tools. Showing partial results while a report is generated keeps users engaged.
  • Long-form generation. Articles, code and analysis that take ten or twenty seconds should stream so users do not assume the app has frozen.

The common thread is a human waiting on the other end. If someone is reading as the response is produced, streaming improves the experience at no extra token cost.

When non-streaming wins#

  • Backend pipelines. Batch jobs, preprocessing and chained calls have no one watching. Non-streaming is simpler to implement, simpler to handle errors for, and returns the complete result in one clean package.
  • Structured output. JSON responses and function-call results must be complete before you can parse them. You can buffer a stream and parse at the end, but that adds complexity for no benefit.
  • High-concurrency environments. Each stream holds a connection open for the full generation. Across hundreds of concurrent requests, those persistent connections consume real server resources.

The cost angle#

Token cost is identical. You send the same prompt and receive the same output either way, and billing is per token, not per delivery method.

Indirect costs can differ. Streams occupy server resources for longer, which can affect throughput behind a proxy or gateway, and infrastructure billed by connection time or concurrency may cost more. Streaming can also save money: if a user sees the first few tokens heading in the wrong direction and cancels, you avoid generating the rest of an unwanted response. Whether streaming is cheaper or more expensive overall therefore depends on your infrastructure and on how often users abandon answers, not on the per-token price.

Implementation tips#

  1. Set timeouts for both modes. Non-streaming calls need a generous overall timeout. Streaming calls need a connection timeout plus a chunk timeout that fires if no data arrives for too long.
  2. Handle mid-stream failures. Connections can drop partway through. Build retry logic that restarts or resumes cleanly.
  3. Go hybrid. Stream in the user-facing layer and use non-streaming calls for backend chains. Most applications end up needing both, so build your client code to support each mode.
  4. Test with your actual models. Some models start emitting tokens almost instantly; others spend longer processing before the first token appears. Measure TTFT and total time for the specific models and prompt sizes you plan to ship.

The rule of thumb: if a user is watching, stream it; if it is a backend pipeline, keep it simple.

Questions from this episode

Does streaming an LLM response make it faster?
Streaming does not reduce total generation time, because the model produces the same tokens either way. It dramatically reduces time to first token, so users start reading almost immediately. That makes the response feel much faster even though it finishes at about the same moment.
Does streaming cost more tokens than a normal API call?
No. Billing is per token, and the prompt and output are the same whether you stream or not. Indirect costs can differ because streams hold connections open longer, while early cancellation of an unwanted streamed answer can save tokens.
Should I stream when I need JSON or function-call output?
Usually not. Structured output must be complete before you can parse it, so streaming forces you to buffer the chunks and parse at the end. A non-streaming call gives you the full result in one package with simpler error handling.

More episodes

All episodes with show notes →

Try it on your own traffic

Crazyrouter gives you one OpenAI-compatible API key for Claude, GPT, Gemini, DeepSeek and more, billed pay-as-you-go.

Get an API key →