SSE Stream Parser — Reassemble OpenAI / Anthropic Streaming Responses
Paste a raw server-sent events (SSE) stream from the OpenAI or Anthropic API and reconstruct the full message text, tool-call arguments, and token usage. Great for debugging streaming responses. 100% local.
Last updated:
CommentsPaste the raw SSE body from an OpenAI or Anthropic streaming response and this tool concatenates every delta back into the full message text, rebuilds tool-call arguments, and surfaces token usage. The format is auto-detected. Everything runs in your browser.
Hello, world!
{
"prompt_tokens": 9,
"completion_tokens": 3,
"total_tokens": 12
}Parsing runs entirely in your browser — the stream is never uploaded. OpenAI and Anthropic formats are auto-detected.
What is SSE Stream Parser?
When you call an LLM with stream: true, the server replies with server-sent events (SSE): many small `data:` lines, each carrying a delta — a few characters of text or a fragment of a tool call's JSON arguments. Reading that raw stream by hand is painful, especially when debugging a truncated response or a malformed tool call. This parser handles both major dialects: OpenAI's choices[].delta.content chunks terminated by data: [DONE], and Anthropic's typed events (message_start, content_block_delta with text_delta or input_json_delta, message_stop). It reassembles the complete assistant text, stitches each tool call's argument fragments back together, and reports the finish reason and any usage numbers — so you can see exactly what the model produced.
How to parse an SSE stream
- 1Copy the raw streaming response body (the data: lines) from your logs or network tab.
- 2Paste it in — the OpenAI vs Anthropic format is detected automatically.
- 3Read the reassembled text, tool-call arguments, finish reason, and usage.
Key Concepts
- delta
- The incremental piece of content in one streaming chunk; clients concatenate deltas.
- data: [DONE]
- OpenAI's sentinel marking the end of the stream.
- input_json_delta
- Anthropic's event type carrying a fragment of a tool call's JSON arguments.
Frequently Asked Questions
What format does a streaming LLM response use?
Server-sent events (SSE): a sequence of lines like `data: {JSON}` separated by blank lines, ending with `data: [DONE]` for OpenAI. Each event carries a small delta — a few characters of text or a slice of a tool-call's arguments — that the client concatenates.
How are OpenAI and Anthropic streams different?
OpenAI sends choices[].delta.content chunks and ends with data: [DONE]. Anthropic sends typed events (message_start, content_block_delta with text_delta or input_json_delta, message_stop). This parser auto-detects which one you pasted and reassembles accordingly.
Can it rebuild tool / function call arguments?
Yes. Tool-call arguments are streamed as JSON fragments across many chunks; the parser concatenates them back into the complete arguments string for each tool call.
Is my stream uploaded?
No. Parsing happens entirely in your browser — the response never leaves your device.
Try Next
Text Chunker
Split long text into overlapping chunks for embedding and RAG pipelines. Preview recursive, paragraph, sentence, or fixed strategies with live token counts. Runs 100% in your browser.
Related Tools
Schema → Tool Definition
Turn a sample JSON payload into function-calling / tool definitions for OpenAI, Anthropic, and Gemini — side by side. Strict-mode toggle adds required + additionalProperties: false. 100% local, paste straight into your tools array.
Chat Messages Validator
Validate a Chat Completions messages array before you send it — checks roles (system/user/assistant/tool), required content, and common mistakes that cause a 400. 100% local.
Prompt Template Tester
Write a prompt with {{variable}} placeholders, fill in values, and preview the final prompt. Detects every variable and flags any you left unfilled. 100% local.
Prompt Diff
Compare two versions of a prompt line by line and see the token delta between them — so you know exactly what changed and whether an edit made the prompt cheaper or more expensive. 100% local.
Embedding Cost Calculator
Estimate the cost of embedding a corpus — pick a model, enter the number of documents and average tokens each, and get the total token count and dollar cost. 100% local.
Vector Storage Calculator
Estimate how much memory or disk your embeddings need — enter vector count, dimensions, and precision (float32/float16/int8/binary) to see raw and indexed size. 100% local.