Docs / Developers / Streaming
Streaming
Ask for a stream and the words arrive as they are made, in the format each API uses.
For developers2 min readUpdated 8 Nov 2026
The three shapes
| Shape | Ask with | Arrives as |
|---|---|---|
| OpenAI | "stream": true |
server-sent events, data: {…} chunks, ended by data: [DONE] |
| Anthropic | "stream": true |
server-sent events: message_start, content_block_delta …, message_stop |
| Ollama | "stream": true (its default) |
JSON lines, application/x-ndjson |
Stopping early
Stop sequences end the answer where they appear: stop (OpenAI), stop_sequences (Anthropic), options.stop (Ollama).
With tools
When tools are given, the answer is formed whole first — a call cannot be streamed half made — and then sent as the same events.