Reference

Streaming

Quick answer
Prism streams every response over Server-Sent Events. It opens a streaming connection to the upstream, translates each event as it arrives, and forwards it immediately — so text, thinking blocks, tool calls and images all reach the client incrementally rather than in one batch at the end.

Last updated Reviewed against Prism v0.3.26

How translation works

Prism does not buffer a stream to translate it. Events are mapped one at a time and written straight through, which keeps time-to-first-token effectively unchanged.

Client ──SSE──▶ Prism ──SSE / NDJSON──▶ Upstream
                  │                        │
                  │  translate event       │
                  │  by event, no buffer   │
                  │                        │
               ◀──SSE stream──────────────┘

What streams correctly

ContentDetail
TextIncremental deltas in every supported protocol.
Thinking / reasoningAnthropic thinking blocks are translated to and from OpenAI reasoning fields.
Tool callsFunction names arrive first, then arguments stream incrementally as fragments.
Structured outputsSchema-constrained output streams the same way as ordinary text.
ImagesMulti-modal image content in messages is translated in both directions.
Responses API eventsThe full Responses sequence is emitted, including response.created, response.output_text.delta, response.function_call_arguments.delta and response.completed.

Format-specific event shapes

ProtocolWire format
OpenAI Chat CompletionsSSE, delta-based chunks terminated by data: [DONE].
OpenAI ResponsesSSE with typed response.* events, including function-call argument deltas.
Anthropic MessagesSSE with typed block events such as content_block_delta.
Ollama native (upstream)NDJSON, one object per token. Prism converts it to SSE for the client.

Web search inside a stream

When an agent calls a web-search tool, Prism intercepts it, runs the search locally, and streams the result back inline as a server tool use plus a search result block. The agent sees a normal tool result and the stream never stalls waiting on a third-party search API.

Two places interception does not run
Search interception is skipped for Codex OAuth accounts and for any model with api: "responses". On those routes the agent's search tool calls pass through untouched. See Web Search for the full rule.

Performance

Per-event translation cost is on the order of microseconds; the upstream provider is always the bottleneck. Because Prism forwards as it translates, adding it in front of a provider does not delay the first token in any measurable way.