Claude API Prompt Caching Pricing Explained
Prompt caching pricing on the Claude API works on a two-tier model: you pay a premium to write a prompt segment into the cache, then pay a steep discount every time you read it back for the next request. In short — writing a cache entry costs more than a normal input token, but reading from an existing cache costs a fraction of a normal input token. If your application sends the same system prompt, tool definitions, or document context on every call, caching turns that repeated overhead into a much cheaper line item.
The short answer to "how much does it actually cost": you pay roughly a 25% premium on the tokens you cache the first time (the write), and then roughly a 90% discount on those same tokens every subsequent time you reuse them (the read), as long as the cache entry hasn't expired. The rest of this article breaks down exactly how that math plays out, what counts as a "read" vs a "write," and how to think about it when you're estimating your monthly bill.
How prompt caching billing actually works
Prompt caching lets you mark a portion of your prompt — usually a long system prompt, a big tool schema, a reference document, or conversation history — as cacheable. The first time Claude processes that block, it has to do the full computation and store the result. That's the cache write, and it's billed at a higher rate than a standard input token because the model is doing extra work to persist the state.
Every request after that, within the cache's time-to-live window, that same block is read from cache instead of reprocessed from scratch. That's the cache read, billed at a steep discount compared to normal input tokens.
There are two cost categories you need to track separately on every API response:
- Cache write tokens — tokens written to cache for the first time (or rewritten after expiry)
- Cache read tokens — tokens served from an existing cache entry
- Regular input tokens — anything outside the cached block, billed at standard rates
- Output tokens — billed at standard rates, caching has no effect on output pricing
The API returns this breakdown in the response usage object, so you can see exactly how many tokens were cache writes vs cache reads on every call. That's important because it's the only way to verify caching is actually saving you money in production rather than assuming it.
Why the pricing shape makes sense
Think of it like a CDN for tokens. The write is expensive because Claude has to compute and store the key-value state for that prompt segment. The read is cheap because the model skips that computation entirely and just reuses the stored state. If you only call an endpoint once, caching costs you more — you pay the write premium and never get the read discount. Caching only pays off when the same prefix is reused multiple times within the cache lifetime.
This is why caching is most valuable for:
- Long, static system prompts reused across thousands of requests
- Large tool/function definitions sent with every call
- RAG pipelines that inject the same reference document into many queries
- Multi-turn conversations where earlier turns don't change
It's a poor fit for prompts that are different on every call, or for low-volume endpoints where you'll rarely hit the same cache entry twice before it expires.
A simplified cost example
Say you have a 2,000-token system prompt plus tool definitions that you reuse on every request, and you make 100 calls in a short window (well within the cache TTL).
Without caching: all 100 calls pay full input price for those 2,000 tokens — 200,000 billable input tokens for that segment.
With caching: the first call pays the write premium on 2,000 tokens. The remaining 99 calls pay the discounted read rate on 2,000 tokens each. Even with the write premium on the first call, the blended cost across 100 calls drops dramatically because 99% of those calls are billed at the deep discount instead of full price.
The breakeven point is usually just two or three reuses — after that, every additional read is close to pure savings. If your traffic pattern reuses the same cached block dozens or hundreds of times per TTL window, the savings compound fast.
Things that quietly reset your cache (and your bill)
A few gotchas that trip people up when they're trying to estimate pricing:
- TTL expiry — cache entries have a limited lifetime. If your traffic is bursty with long gaps, you may be paying the write premium repeatedly instead of benefiting from reads.
- Prompt drift — caching works on exact prefix matches. If you change even a token inside the cached block (a timestamp, a dynamic variable placed too early in the prompt), you invalidate the cache and pay a fresh write.
- Ordering matters — put the static, cacheable content first in your prompt and the dynamic, per-request content after it. If dynamic content comes first, nothing downstream can be cached effectively.
- Multiple cache breakpoints — you can cache more than one segment per request, but each breakpoint is billed independently, so track them separately in your usage logs.
Tracking cache costs when you're building on top of the API
If you're routing Claude access through SubToAPI rather than calling Anthropic's API directly, your application keys (sub_live_...) still get full usage metadata on every response, including the input/output/cache token breakdown, so you can reconcile actual spend against what prompt caching should be saving you. That's useful if you've got multiple team members or services sharing one Claude plan and you want to see, per API key, whether caching is actually paying off or whether a particular integration is invalidating the cache on every call. See /docs/messages for the exact response shape, and /docs/streaming if you're caching prompts in a streaming pipeline. Plans start at €9/month on the Solo tier with a free trial at /signup, and full pricing is at /pricing.
questions
Does prompt caching cost extra on top of my normal API usage? No — it replaces part of your normal input token cost. You pay a premium only on the first write, then a discount on every subsequent read, instead of full price on every call.
How long does a cached prompt stay valid before I have to pay the write price again? Cache entries have a limited time-to-live and expire if unused. High-frequency endpoints keep cache entries "warm" by reusing them often enough that they rarely hit full expiry.
Is prompt caching worth it for low-traffic applications? Usually not. If the same cached prefix isn't reused at least a few times before it expires, the write premium outweighs the savings from reads, so caching mainly pays off at moderate-to-high request volume.