Parse Claude token usage and estimate cost
The Anthropic Usage Stats Parser reads the usage object from a Claude
Messages API response and breaks out every token category Anthropic bills
separately: regular input, output, cache-creation (writes), and cache-read
(hits). It then estimates the dollar cost using the correct rate for each
category. No API key is required — you are parsing a response you already have.
How it works
The tool parses your JSON and reads usage.input_tokens,
usage.output_tokens, usage.cache_creation_input_tokens, and
usage.cache_read_input_tokens. Anthropic bills these at different rates: cache
writes cost 1.25× the base input price, while cache reads cost only 0.1×. The
estimate multiplies each bucket by the right per-million-token price for the
model you select, then sums them. Everything runs locally.
Tips and notes
A healthy prompt-caching setup shows large cache_read_input_tokens and small
cache_creation_input_tokens after the first call — that is where the savings
come from. If you see cache creation on every request, your cache breakpoints or
TTL may be wrong. Use this alongside the OpenAI usage parser when comparing
providers so you are reading the same kind of numbers. Nothing you paste leaves
your browser.