Worked examples
The simulator's four example sessions on Claude Opus 4.8 with the 5 minute cache, priced turn by turn by the same cost model. Default lifetime. Each read refreshes it at no extra cost.
-
Coding agent
Tool calls and edits in quick succession, with a few longer pauses. 40 turns, 20K tokens of starting context, 3K in and 600 out per turn, 1.5 minutes apart, three long breaks of 8 minutes.
Open this in the simulator- With caching
- $5.23
- Without
- $19.24
- Saved
- $14.01 73%
- Pays for itself on turn 2
- Cache goes cold 3 times
-
Long chat
A person reading and typing, with one long break. 30 turns, 3K tokens of starting context, 150 in and 500 out per turn, 3 minutes apart, one long break of 45 minutes.
Open this in the simulator- With caching
- $0.76
- Without
- $2.26
- Saved
- $1.50 66%
- Pays for itself on turn 2
- Cache goes cold 1 time
-
Big document
One large document, questioned a dozen times. 12 turns, 150K tokens of starting context, 100 in and 700 out per turn, 7 minutes apart.
Open this in the simulator- With caching
- $11.80
- Without
- $9.48
- Caching adds
- $2.32 24%
- Never pays for itself in this session
- Cache goes cold 11 times
-
Unattended loop
A script calling the model nonstop, the prompt growing every turn. 200 turns, 30K tokens of starting context, 1.5K in and 300 out per turn, 30 seconds apart.
Open this in the simulator- With caching
- $24.80
- Without
- $212.10
- Saved
- $187.30 88%
- Pays for itself on turn 2
- Cache stays warm the whole way
The coding agent on each cache setting
The same 40-turn session, changing only the cache setting. Without caching it costs $19.24.
| Cache setting | With caching | Saved | Share saved | Pays off on turn |
|---|---|---|---|---|
| 5 minutes | $5.23 | $14.01 | 73% | 2 |
| 1 hour | $4.02 | $15.22 | 79% | 3 |
When caching pays for itself
For a prefix sent again and again inside the cache lifetime. The count does not depend on the prefix size, as long as it is above the minimum.
5 minutes
A write costs $6.25 per million tokens instead of $5.00, and each read within the lifetime costs $0.50 instead of $5.00.
A cached prefix pays for itself after 1 read within the lifetime.
Lifetime Default lifetime. Each read refreshes it at no extra cost.
1 hour
A write costs $10.00 per million tokens instead of $5.00, and each read within the lifetime costs $0.50 instead of $5.00.
A cached prefix pays for itself after 2 reads within the lifetime.
Lifetime Costs more to write, reads cost the same.
Caching rules for Claude Opus 4.8
- You mark cache breakpoints, or turn on automatic caching, which moves the breakpoint to the last cacheable block as the conversation grows. You pay a read for the longest prefix that hits and a write for the rest.
- A write costs 1.25x the input price for the 5 minute cache and 2x for the 1 hour cache. A read costs 0.1x.
- Each read refreshes the lifetime at no extra cost. The lifetime counts from the start of the request that writes or reads the cache.
- The minimum cacheable prompt is 1,024 tokens. Shorter prompts are processed without caching, and no error is returned.
- There is no long-context premium. Anthropic states this for Claude 4.6 and later models other than Haiku 5.5.
Sources: Anthropic's pricing page, caching guide. See all prices and sources.
Similar models
Per million tokens, with the 40-turn coding agent on each model's default cache setting.
| Model | Input | Cache read | Output | Coding agent |
|---|---|---|---|---|
| Claude Opus 4.8 | $5.00 | $0.50 | $25.00 | $5.23 |
| Claude Opus 5 | $5.00 | $0.50 | $25.00 | $5.23 |
| Claude Opus 5.5 | $4.00 | $0.20 | $20.00 | $3.53 |
| GPT-5.5 | $5.00 | $0.50 | $30.00 | $3.50 |
| Gemini 4 Argon | $2.00 | $0.10 | $10.00 | $0.92 best case* |
* Gemini implicit caching, best case.
Questions
How much does prompt caching cost on Claude Opus 4.8?
Input costs $5.00 per million tokens, $6.25 to write the 5 minute cache, $10.00 to write the 1 hour cache, $0.50 to read it and $25.00 for output.
Is prompt caching worth it for Claude Opus 4.8?
In the 40-turn coding agent example, caching costs $5.23 against $19.24 without, a saving of $14.01 (73%). With the 5 minute cache, a cached prefix pays for itself after 1 read. It loses money only when the cache expires before it is read again.
How long does the Claude Opus 4.8 cache last?
5 minutes: Default lifetime. Each read refreshes it at no extra cost. 1 hour: Costs more to write, reads cost the same.
Does Claude Opus 4.8 have a minimum cacheable prompt length?
Yes. Prompts shorter than 1,024 tokens are not cached.
An estimate from published list prices, and your bill may differ. Token counts are what the example sets, not tokenized text. Not covered: batch and fast-mode prices, thinking tokens beyond the output shown, tool fees and regional uplifts.