01What is LLM SSE Stream Parser?
LLM SSE Stream Parser takes the raw text of a streaming response, the event: and data: lines you see with curl -N or in a network log, and puts the answer back together. Reading a stream by eye is slow, because one sentence arrives as dozens of small JSON fragments. Tool call arguments are even harder, since they come as broken pieces of a JSON string. The stream is first split into events using the rules in the WHATWG HTML standard. A blank line ends an event, and lines starting with a colon are comments. Several data lines are joined with newlines, and one space after the colon is dropped. CRLF, CR and LF line endings all work, and a leading byte order mark is ignored. One lenient choice differs from the standard: a final event with no blank line after it is still kept, so a pasted stream that was cut short is not lost. Each event's data is parsed as JSON and the API is detected from the event types. For the Anthropic Messages API it joins text_delta pieces, collects thinking_delta text, and builds each tool_use block's input from its input_json_delta fragments. Usage starts from message_start and is updated by message_delta, which also gives the stop reason. An error event is reported. For OpenAI Chat Completions it joins choices[0].delta.content, merges tool_calls fragments by their index, reads finish_reason, picks up the usage chunk sent when include_usage is on, and treats data: [DONE] as the end. For the OpenAI Responses API it joins response.output_text.delta, starts a function call at response.output_item.added, appends response.function_call_arguments.delta and takes usage and status from response.completed. For Gemini streamGenerateContent with alt=sse it joins text parts, separates parts marked as thoughts, collects functionCall parts and keeps the latest usageMetadata. Here is a worked example. Paste an Anthropic stream where two content_block_delta events carry the text "Hel" and "lo", followed by a message_delta with stop_reason end_turn. The tool detects the Anthropic Messages API, shows the text Hello, and reports end_turn as the stop reason. The usage panel shows the token counts from the stream. Tool call arguments are shown pretty-printed, or with an error when the joined JSON does not parse, which usually means the stream was cut off. An event whose data is not valid JSON is listed with its parse error. If no known event shape is found, the tool says it could not tell which API produced the stream. Every event is listed in order underneath. Limits: only the first choice or candidate is rebuilt, and other event types are listed but not interpreted. It cannot show anything the stream did not contain. It runs in your browser, so pasted streams are not uploaded.
Developers building or debugging streaming clients, agents and proxies on top of OpenAI, Anthropic or Gemini APIs. The tool runs entirely in your browser, so your data never leaves your device.
02How to use LLM SSE Stream Parser
- Capture the raw stream, for example with curl -N, or copy it from your browser's network tab
- Paste it into the input box, or load an example
- Check the detected API, the stop reason and whether the end marker was seen
- Read the final text, tool calls and usage, and copy what you need
- Open All events to inspect each event in order
03Worked examples
- Input:
Anthropic stream: text_delta "Checking", a tool_use block get_weather whose input_json_delta arrives in two pieces ("San Fra" + "ncisco"), then message_delta with stop_reason tool_use and output_tokens 42 - Result:
Provider: anthropic. Text: Checking. Tool call get_weather (toolu_1) {"location": "San Francisco"}. Usage {"input_tokens":25,"output_tokens":42}. Stop: tool_use - The partial_json pieces are joined into one arguments string before parsing. Input tokens come from message_start and output tokens from message_delta.
- Input:
OpenAI Chat Completions chunks with content "Hel" + "lo", a tool_calls fragment get_weather, a usage chunk with empty choices, ending in data: [DONE] - Result:
Provider: openai-chat. Text: Hello. Tool call get_weather (call_1) {"city":"Paris"}. Usage {"prompt_tokens":10,"completion_tokens":5,"total_tokens":15}. Stop: tool_calls - Tool call arguments are merged by their index field. The final usage chunk only appears when stream_options.include_usage is set.
- Input:
Gemini alt=sse chunks "The sky" and " is blue." with finishReason STOP - Result:
Provider: gemini. Text: The sky is blue. Usage {"promptTokenCount":4,"candidatesTokenCount":5,"totalTokenCount":9}. Stop: STOP - Gemini has no end marker, so the stream counts as done once a finishReason arrives. Usage is taken from the last chunk.
- Input:
OpenAI Responses API events: response.created, two response.output_text.delta events ("Two plus two" + " is four."), then response.completed with usage - Result:
Provider: openai-responses. Text: Two plus two is four. Usage {"input_tokens":12,"output_tokens":6,"total_tokens":18}. Stop: completed - The Responses API uses typed event names instead of chat chunks. The status on response.completed is reported as the stop reason.
- Input:
Anthropic stream that sends a text_delta "Let me sum" and then an error event of type overloaded_error, with no message_stop - Result:
Provider: anthropic. Text: Let me sum. Stop: none. Errors: Stream error: overloaded_error Overloaded. Done: false - An error event can arrive mid-stream after a 200 status. The partial text is kept, and the missing message_stop shows the stream did not finish.
04Common use cases
- Debugging why a streamed tool call's arguments arrive as broken JSON
- Reading a captured curl -N response without writing a parser
- Checking the token usage and stop reason at the end of a stream
- Comparing how OpenAI, Anthropic and Gemini stream the same request
- Writing test fixtures for your own streaming client
05Tips
- If Complete says no end marker was seen, the stream was cut off before the end
- OpenAI Chat Completions only sends usage when stream_options.include_usage is true
- Anthropic's message_delta usage is cumulative, so the last value is the total
- For Gemini, add alt=sse to streamGenerateContent to get server-sent events
06Related concepts
Server-sent events, text/event-stream, Streaming, Tool calls, input_json_delta, Token usage.
Frequently Asked Questions
What is LLM SSE Stream Parser?
LLM SSE Stream Parser is a free, browser-based developer tool on AIDToolStack. Paste a raw server-sent events stream from OpenAI, Anthropic or Gemini and see the final text, tool calls, usage and every event. Runs in your browser. It requires no installation or sign-up and works entirely in your browser.
Is LLM SSE Stream Parser free to use?
Yes. No sign-up, no fees and no usage cap.
Does LLM SSE Stream Parser store my data?
No. It runs in your browser; nothing is uploaded.