Every model on Claude’s pricing page comes with two headline numbers: what a million input tokens cost, and
what a million output tokens cost. They’re easy to compare, and they’re what gets quoted when a new model
comes out. If you use Claude through an agent like Claude Code, though, they explain very little of the bill.
In my own usage, input tokens were $0.04 of about $304. Cache reads and cache writes were 69% of it.
This post goes through why, starting with what you’d expect it to cost to fill Claude’s 1M-token context
window, and ending with what it actually costs.
What a full context window looks like it costs
Take Opus 5.5, which lists at $4 per million input tokens and $20 per million output tokens.1 Filling a
1M-token window means about a million tokens. Say 160k of them were written by Claude, and the rest are
things like file reads, command output and my own messages. That’s about $3.34 of input and
$3.27 of output, so around $6.61. A few dollars to fill the window.
The window isn’t sent once
That estimate treats the context as something you pay for once, as you build it up. But the model doesn’t
remember anything between requests, so every request carries the whole conversation so far: the system
prompt, every message, every file read and every command output.2 The 1M window is the size of the
last request, not the only one.
Getting there also takes a lot of requests. In an agent session, each turn is typically a tool call: Claude
asks to read a file or run a command, and the result goes back in. Say each turn adds 3k tokens to the
context, 500 of them written by Claude and the rest tool output, starting from a 20k-token system prompt
and project context. That’s 327 requests to reach 1M.
Context sent with each request
Tokens sent with each request
0200k400k600k800k1.0M
Turns 1–109110–218219–327
One session growing to a full 1M-token window, adding 3k tokens per turn.Show numbers
Requests
Tokens sent in total
Largest request
Tokens sent with each request
327
166.4M
998k
The shaded area is everything sent to the model: 166.4M tokens in total, about
166 times the size of the window. If all of that were billed as
ordinary input at $4 per million, filling the window would cost $669.04, not
$6.61.
Three prices that aren’t input or output
It doesn’t cost $669.04, because of prompt caching. The API keeps the processed prefix of a request
for a while, and when the next request starts with exactly the same content, it’s billed at a much lower
rate for reading it, and only the new tokens at the end need processing.3 That makes three prices apply
to a request, on top of output:
Token type
Price per million tokens
Relative to input
Input
$4.00
1x
Cache write (5-minute cache)
$5.00
1.25x
Cache write (1-hour cache)
$8.00
2x
Cache read
$0.20
0.05x
Output
$20.00
5x
In a long session, almost every token falls in one of the cache rows. The start of each request is the whole
of the previous one, so it’s a cache read. The new tokens at the end are written to the cache, and so are a
cache write. Plain input is only what’s left over after that, which is next to nothing.
Here’s the session from the chart priced that way, on Opus 5.5 with the 5-minute cache:
Tokens
Price per million
Cost
Share
Input
about 0
$4.00
$0.00
0%
Cache read
165.4M
$0.20
$33.09
80%
Cache write
998k
$5.00
$4.99
12%
Output
164k
$20.00
$3.27
8%
Total
$41.35
The total is about 6 times the naive estimate of
$6.61, and the line that explains most of the difference is the cache read. Each token
is written to the cache once, and the $4.99 that costs is about what the naive estimate
said the input would cost. What the estimate left out is that every one of those tokens is then read
again on every later turn.
Caching is also why the total isn’t $669.04. Cache reads are 80% of the bill and also the reason the
bill is about 16 times smaller than it would have been. Input and
output are the prices everyone quotes, but the cache read is what you pay for most of the time.
Cost grows with the square of the context
Every turn reads everything before it, and every turn adds to what the next one will read. So the total
isn’t proportional to the context size. After n turns of about the same size, the reads add up to about
n²/2 turns’ worth of tokens. In this model, getting to 500k tokens costs $12.38
and getting to 1M costs $41.35: twice the context, more than three times the cost.
I went into this in Subagents make Claude Code cheaper, where it
shows up in real sessions too. This is that post’s chart of 101 of my own sessions, with cost so far
plotted against context size:
A fit to those sessions gives an exponent of 1.9, close to the 2 the reasoning predicts. The real curve is
steeper than my model, though: it reaches $135 at 800k tokens, where the model above says about
$27.85. I picked a generous 3k tokens per turn. Many real turns add much less,
like a short search or a one-line reply, so the same context takes more turns to build, and each of them
reads all of it. Real sessions also have cache expiries, the orange jumps in the chart.
What my own bill looks like
This is a breakdown of my own Claude Code spending by token type:
The total is $304.40, and it splits like this:
Cost
Share
Input
$0.04
0.01%
Cache write, 5-minute and 1-hour
$79.04
26%
Cache read
$132.11
43%
Output
$71.57
24%
Not in transcripts
$21.64
7%
Input is $0.04 out of $304, about one dollar in every 7,600. The two headline prices account for the 24% that
is output, and almost nothing else. “Not in transcripts” is cost the tool couldn’t break down by token
type. It’s probably mostly compaction, web searches and other things the API doesn’t report as individual
requests, so I’m leaving it out of the comparison. Cache reads and cache writes together are $211.15, or
69% of everything, and 75% of what the chart could attribute to a token type.
My model said 80% reads, 12% writes and 8% output, so the split is different. I can’t say how much each of
these contributes, but they’re all things a simple model leaves out, and they all push the same way:
More output. Thinking tokens are billed as output tokens,4 and a real turn often has more to say
than 500 tokens.
More writes. Every new session and every subagent writes its starting context from scratch, and every
cache expiry writes the whole context again. Claude Code also uses the one-hour cache on a
subscription, which costs 1.6 times the 5-minute write price.5
A smaller share of reads. Most sessions end far short of 1M tokens, and reads are the part that grows
fastest with session size, so the many small sessions dilute them.
None of that changes the conclusion. The proportions move around, but input is still zero and the cache
is still most of the bill.
The cache price decides which model is cheaper
If input and output prices aren’t what you pay for, then they’re a poor way to compare models. The cache
read price is set separately from the input price, as a different fraction of it for each model:1
Model
Input
Cache read
Cache read as share of input
The 1M session
Claude Sonnet 5.5
$2
$0.10
5%
$20.67
Claude Opus 5.5
$4
$0.20
5%
$41.35
Claude Opus 5
$5
$0.50
10%
$93.05
Claude Fable 5.1
$10
$0.25
2.5%
$62.01
Opus 5 has an input price only 25% higher than Opus 5.5’s, so it looks like a small step up. Its cache read
is 2.5 times as expensive, and the same session costs $93.05
instead of $41.35. Claude Fable 5.1 goes the other way: its input price is 2.5 times Opus 5.5’s,
but its cache read is only 25% higher, so the session costs about
1.5 times as much, not 2.5.
Cache read
Cache write
Output
Sonnet 5.5
$20.67
Opus 5.5
$41.35
Opus 5
$93.05
Fable 5.1
$62.01
The same 327-turn session to a full 1M window at each model's list prices, with the 5-minute cache.Show numbers
Cache read
Cache write
Output
Total
Sonnet 5.5
$16.54
$2.50
$1.64
$20.67
Opus 5.5
$33.09
$4.99
$3.27
$41.35
Opus 5
$82.72
$6.24
$4.09
$93.05
Fable 5.1
$41.36
$12.47
$8.18
$62.01
This holds the token counts fixed, which isn’t how models compare in practice: a more capable model might
finish a task in fewer turns, and a different tokenizer changes how many tokens the same text takes. What
it shows is that the pricing page’s input and output columns don’t tell you the cost of a long session by
themselves. The cache columns do.
The pricing page also says that Claude 4.6 and later models, other than Haiku 5.5, include the full 1M
window at standard pricing,6 so there’s no extra charge for the big window itself. The cost of a
big session comes from the replays, not from the size.
What this changes
Compare models by cache price. Look at cache read and cache write columns first, and treat input and
output as the small part. Multiply by the number of turns you expect, not by the size of one request.
Context size is the multiplier. Anything that keeps the context small cuts the cost of every later turn.
Clearing between tasks, compacting at natural breaks and handing reading-heavy work to
subagents all do that.
An expired cache is expensive. At 1M tokens, one more turn with a warm cache costs $0.20.
After the cache expires, the same turn is a write: $5.00 on the 5-minute cache and
$8.00 on the 1-hour one. That’s 25 to
40 times as much, and the reason I keep a cache countdown in my
status line.
References
Footnotes
Claude API docs, Pricing. Prices as of October 2026. “Cache hits and refreshes on Claude Opus 5.5 and Claude Sonnet 5.5 are priced at 0.05x the base input price.” The other models use 0.1x, except Claude Fable 5.1 at 0.025x. ↩↩2
Claude Code docs, How Claude Code uses prompt caching: “The model doesn’t remember anything between requests, so Claude Code re-sends the full context: the system prompt, your project context, every prior message and tool result, and your new message.” ↩
Claude Code docs, How Claude Code uses prompt caching: “Without caching, the API would reprocess your full history on every turn. With caching, it reuses what it already processed, bills the re-read at the cached token rate, and fully processes only what changed.” ↩
Claude API docs, Extended thinking: the usage.output_tokens_details.thinking_tokens field “reports how many of the billed output tokens were internal reasoning.” ↩
Claude Code docs, How Claude Code uses prompt caching: on a Claude subscription within plan usage, the main conversation gets a one-hour cache; with an API key it gets five minutes. At Opus 5.5 prices a one-hour write is $8 per million tokens and a five-minute write is $5. ↩
Claude API docs, Pricing, long context pricing: “(A 900k-token request is billed at the same per-token rate as a 9k-token request.) Prompt caching and batch processing discounts apply at standard rates across the full context window.” ↩