Fluxio
← Back to the blog

Responses API Streaming: A Guide to Live Replies

SSE & APIsEN

§1 The Responses API turns a reply into an event stream

A live AI reply feels different from a loading spinner followed by a wall of text. Words appear while the model is still working, giving people something useful to read sooner. The Responses API supports this experience through streaming: your application receives updates as a response develops instead of waiting for the finished result.

Think of a response as a container for the model’s work. It can include message text, tool calls, and other output items. Streaming reveals that work through named events, so your application can distinguish new text from a status change or a tool request.

§2 SSE carries updates over one open connection

To request streaming, send a Responses API request with stream set to true. With a compatible OpenAI-style endpoint, the request goes to /v1/responses. Instead of returning only a completed JSON response, the server sends a sequence of server-sent events, commonly called SSE.

SSE uses a long-lived HTTP connection that carries updates from the server to your application. You do not need a WebSocket just to display a streamed answer. An SDK can usually parse the stream and let your code iterate over structured events.

Although people often say replies arrive “token by token,” a text event is not guaranteed to contain exactly one token. An update may contain a word fragment, a word, or a longer chunk. Render the text you receive rather than trying to reconstruct token boundaries.

§3 Responses API event names explain what changed

Event types give each update a clear purpose. A beginner-friendly implementation can start with a small set, then add support for tools and richer output.

  • – response.created indicates that the response has been created and provides its initial state.
  • – response.output_text.delta carries an incremental text fragment that your interface can append to the relevant output.
  • – response.output_text.done marks the completion of a text part, not necessarily the entire response.
  • – response.completed signals that the response has successfully finished.
  • – response.failed and response.incomplete identify unsuccessful or unfinished outcomes that need separate handling.

You may also encounter an error event. Treat event types as instructions for your application, not as text to display in the conversation.

§4 Text deltas belong to specific output items

For a basic chat interface, the main loop is straightforward: receive an event, check its type, and append any text delta to the visible answer. Keep a loading indicator active until you receive a terminal response event or detect a connection problem.

More advanced responses can contain multiple output items or content parts. Use the identifiers and indexes supplied with events to route updates correctly. Appending every fragment to one string can mix content that belongs in separate places.

Also remember that network chunks and SSE events are different things. If you parse the HTTP stream yourself, one network chunk might contain part of an event or several events. A maintained SDK or SSE parser handles this framing more reliably than splitting incoming data casually.

§5 Tool calls and interrupted streams need separate handling

A streamed tool call is not an answer for the user. Function arguments can arrive incrementally, and partial arguments may not yet be valid JSON. Wait for the appropriate completion signal, validate the finished arguments, and apply your normal authorization checks before executing anything.

A dropped connection is not proof that the response completed. Preserve the partial answer, mark it as interrupted, and offer an explicit retry. Avoid silently repeating tool actions, especially actions that create records or move money.

§6 Fluxio fits streaming-first model access

Fluxio is worth considering when you want a streaming-first, pay-per-token relay with one key for multiple model providers. It works with OpenAI SDKs and tools such as Claude Code, Codex, and Gemini CLI, which can simplify experimenting across providers.

Before wiring up your event handler, confirm that your selected route supports the Responses API and the event types your application expects. OpenAI SDK compatibility alone does not guarantee identical endpoint coverage or streaming behavior across every model.

Sign up for Fluxio to explore streaming AI replies.

Create a Fluxio account →

More from the current