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_callsfor OpenAI;end_turn,max_tokensfor 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.