LLM SSE Stream Decoder

Paste raw SSE bytes from an OpenAI or Anthropic streaming response and instantly decode the assembled text, finish/stop reason, and a per-event breakdown. Supports OpenAI chat completions, OpenAI responses API, and Anthropic Messages streaming — select the format before running.

How to use the LLM SSE Stream Decoder

Paste the raw bytes of an SSE response — exactly as you would see in a terminal using curl -N — into the top textarea. Each line should start with data: followed by a JSON object, or be data: [DONE] for OpenAI streams. Select the API format that matches your stream source, then click Decode.

The tool outputs:

  • The assembled message text — all deltas concatenated in order.
  • The finish/stop reason — e.g. stop, length, tool_calls for OpenAI; end_turn, max_tokens for Anthropic.
  • A per-event table showing the index, event type, and delta content for each parsed event.

Use the Example button to load a realistic sample stream for the selected format and see the decoder in action before pasting your own data.

Server-Sent Events and LLM streaming

Server-Sent Events (SSE) is the W3C standard used by OpenAI and Anthropic to stream partial completions to clients in real time. The wire format is simple: each event is a data: prefixed line of text, events are separated by blank lines, and a stream ends with either data: [DONE] (OpenAI) or a terminal event like message_stop (Anthropic). The browser EventSource API and HTTP client libraries handle the framing; debugging requires reassembling the raw bytes manually.

Each API has its own JSON schema for delta events. OpenAI chat completions place the token delta at choices[0].delta.content and signal the end with a separate data: [DONE] sentinel. The newer Responses API emits named event types (response.output_item.added, response.text.delta). Anthropic emits events with a top-level type field; text deltas arrive as content_block_delta events with delta.type === "text_delta" and delta.text, while message_stop terminates the stream and message_delta carries the stop reason.

Common debugging scenarios: a stream that terminates early (max_tokens hit), a stream where tool_calls appear instead of text, or verifying that all delta chunks were received in order after a network interruption. This decoder surfaces all three.

Common use cases

  • Debugging truncated responses — paste a stream to see exactly where it stopped and what the finish reason was.
  • Verifying streaming integration — confirm your client code reassembles deltas in the correct order.
  • Comparing API formats — see side-by-side how OpenAI and Anthropic structure their stream events.
  • Inspecting tool call streams — decode streams where the model is generating function call arguments incrementally.
  • Learning the SSE protocol — use the event table to understand exactly which event types fire in what order.

Frequently asked questions

Why does my stream end with data: [DONE] and no text?

This usually means the model returned a tool_calls delta instead of a content delta. The assistant is calling a function rather than generating text. Check the event table for a delta with role assistant and tool_calls content.

What is the difference between OpenAI Chat and Responses API formats?

Chat Completions wraps deltas in a choices[0].delta object and uses data: [DONE] to end. The Responses API (for the newer /v1/responses endpoint) uses named event types like response.text.delta and response.completed instead.

How do Anthropic streams differ from OpenAI?

Anthropic uses a top-level type field on every event. Text arrives in content_block_delta events with delta.text. The stream ends with a message_stop event; the stop_reason appears in a preceding message_delta event. There is no [DONE] sentinel.

Can I debug tool call argument streams?

Yes — for OpenAI, tool call argument chunks appear in choices[0].delta.tool_calls[0].function.arguments. The decoder will show these in the event table; the assembled text output will be empty since there are no content deltas.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: