Features

Streaming

Streaming is a way of receiving a model's answer while it is being written, in small pieces sent as server-sent events, rather than as one response once the whole answer is finished.

Also called Server-sent events, SSE streaming, Token streaming

Checked November 29, 2026

At a glance

Turn it on
"stream": true
Sent as
Server-sent events over HTTP
Usage
The last chunk (Chat, with include_usage); message_delta (Messages)
Errors
An error event inside the stream, after a 200
On /model
Keep-alives every 15 seconds; no time limit while tokens flow

By default the API generates the whole answer before it sends anything back. With "stream": true, the answer arrives as it is generated, over server-sent events (SSE) (OpenAI, Anthropic). The first words show up in moments, which matters in a chat window and for long answers.

What a stream looks like

  • Chat Completions sends data: lines, each a chunk with a piece of the message, and ends with data: [DONE].
  • Anthropic's Messages API sends named events: message_start, then content_block_start, content_block_delta and content_block_stop for each block, then message_delta and message_stop, with ping events in between (Anthropic).
  • The Responses API sends typed events, from response.created to response.completed.

Errors in the middle of a stream

Once a stream has started, its HTTP status is already 200, so an error can only arrive as an event in the stream: Anthropic notes that error handling then doesn't follow the usual mechanisms (Anthropic). If you read a stream yourself, watch for error events, not just the status.

Streaming on /model

  • Every text endpoint streams with "stream": true, as the same events OpenAI and Anthropic send. Tool calls, thinking and usage work streamed or not (Streaming).
  • On /v1/chat/completions, a stream reports usage only if you set stream_options.include_usage: then the last chunk before [DONE] carries it. On /v1/messages, usage comes in message_start and message_delta.
  • When nothing has been sent for 15 seconds, for example while a model thinks, the stream gets a keep-alive: a : keep-alive comment line on chat, a ping event on messages. The SDKs skip both.
  • A stream that breaks after it has started ends with a stream_interrupted error event, and you pay only for what was delivered (Errors).
  • A streamed answer has no time limit while tokens keep coming; a non-streaming one stops at 15 minutes (Limits and timeouts).
A streamed chat completion with curl
curl https://api.slashmodel.com/v1/chat/completions -N \
  -H "Authorization: Bearer $SLASHMODEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.1-sol",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true,
    "stream_options": {"include_usage": true}
  }'

Where it applies on /model

Questions

Does streaming cost more?

No. The tokens are the same; only the way they're delivered changes.

Should I stream?

For chat windows and long answers, yes: the first words show at once, and a long answer doesn't run into a client timeout. For short calls whose whole answer you parse, either works.

Why does my stream have ": keep-alive" lines?

/model sends one when nothing has been sent for 15 seconds, for example while a model thinks before its first token. The SDKs skip them; if you read the stream yourself, ignore lines that start with :.

Sources

The makers' own pages, each opened on November 29, 2026.

One key for every model here.

Top up from $10, change one URL, and pay only for the tokens you use.