Skip to content

Anthropic Stream Event Viewer

Decode an Anthropic Messages SSE stream into text, thinking and tool_use blocks, stop_reason and token usage including cache writes and reads.

Anthropic Stream Event Viewer

14 events parsed, 3 content blocks reconstructed

Message

ID
msg_01XYZ
Model
claude-opus-4-7
Role
assistant
Stop reason
tool_use
Model is requesting a tool call; supply tool_result and resume.

Usage

Input
42
Output
89
Cache write
0
Cache read
1,240

Reconstructed content blocks (3)

[0]thinking
The user asked about caching. I should explain the difference between cache_creation and cache_read.
[1]text
Prompt caching has two phases: write and read.
[2]tool_useget_pricing
accumulated input_json:
{"model":"sonnet"}
{
  "model": "sonnet"
}

Event counts

content_block_delta5
content_block_start3
content_block_stop3
message_start1
message_delta1
message_stop1

Event timeline

#typesummary
0message_startmodel=claude-opus-4-7
1content_block_startidx=0 type=thinking
2content_block_deltaidx=0 delta=thinking_delta
3content_block_deltaidx=0 delta=thinking_delta
4content_block_stop
5content_block_startidx=1 type=text
6content_block_deltaidx=1 delta=text_delta
7content_block_stop
8content_block_startidx=2 type=tool_use name=get_pricing
9content_block_deltaidx=2 delta=input_json_delta
10content_block_deltaidx=2 delta=input_json_delta
11content_block_stop
12message_deltastop_reason=tool_use
13message_stop

What this tool does

The Anthropic Stream Event Viewer decodes a raw message_stream from the Claude API, parsing typed events like message_start, content_block deltas, tool_use, and thinking. It reconstructs the full reply and stop_reason and breaks down per-call token usage, including cache-write and cache-read counts, so you can debug streaming and verify billing in your browser.

Updated . Provided as is. Check the output before you rely on it in production.

How to use Anthropic Stream Event Viewer

  1. 1

    Drop the message_stream log

    Paste a raw Anthropic SSE capture — the typed event names like message_start, content_block_delta, and message_stop must remain on their own lines, with JSON payloads on data lines.

  2. 2

    Read the message header

    The Message panel surfaces the message id, model, role, and stop_reason as soon as those events arrive. A short note explains every stop_reason value (end_turn, tool_use, max_tokens, refusal, pause_turn).

  3. 3

    Walk reconstructed content blocks

    Text, thinking, and tool_use blocks are reassembled from their deltas. tool_use blocks show the accumulated partial_json and parse it once it becomes valid JSON so you can verify tool inputs end-to-end.

  4. 4

    Audit usage and the timeline

    The Usage panel separates input, output, cache_creation_input_tokens, and cache_read_input_tokens. The event timeline lets you click any event to see its full JSON payload for deeper debugging.

Questions and answers

Which events does it understand?
All Anthropic message_stream typed events: message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop, ping, and error. Unknown event types render as raw JSON for inspection.
How are content blocks reconstructed?
text_delta, thinking_delta, and input_json_delta payloads accumulate against the index from each content_block_start. tool_use input_json is rendered raw and re-parsed once it becomes valid JSON so you can verify tool arguments.
What does the usage panel show?
input_tokens, output_tokens, cache_creation_input_tokens, and cache_read_input_tokens — the four counters Anthropic emits. Cache write and cache read are colored differently so you can audit prompt-cache effectiveness in one glance.
Does it send my data to a server?
No. The viewer parses your SSE log, reconstructs content blocks, and renders usage entirely in your browser. Stream contents never leave your device.
How does it differ from a generic SSE replayer?
It speaks Anthropic's typed event vocabulary. Stop reasons get plain-English notes, tool_use input_json reassembles into valid JSON, and the four-channel usage breakdown is specific to Claude prompt-cache accounting.
For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/anthropic-stream-event-viewer/

For automation planning, fetch the canonical contract at /api/tool/anthropic-stream-event-viewer.json.