Prompt caching can cut the input cost of a long prompt by about 90%. It can also make every request 25% more expensive. Which one you get depends on how often the same prefix is reused before the cache expires.
How caching is billed
With Anthropic's Claude, you mark the part of the prompt to cache: usually the system prompt, tool definitions or a long document. The first request writes it to the cache at a higher price; later requests that start with the same prefix read it at a much lower price.
| Claude Sonnet 4.5, per million tokens | Price | Compared with input |
|---|---|---|
| Input | $3.00 | 1× |
| Cache write | $3.75 | 1.25× |
| Cache read | $0.30 | 0.1× |
| Output | $15.00 | 5× |
By default the cache lives for about five minutes and the timer resets each time it's read. If no request reuses the prefix in that window, the next one pays the write price again.
The break-even point
Take a 10,000-token system prompt on Claude Sonnet 4.5, sent with every request:
| Requests within the cache lifetime | Without caching | With caching | Difference |
|---|---|---|---|
| 1 | $0.030 | $0.0375 | 25% more |
| 2 | $0.060 | $0.0405 | 33% less |
| 10 | $0.300 | $0.0645 | 79% less |
| 100 | $3.000 | $0.3345 | 89% less |
With caching, the cost is one write ($0.0375) plus $0.003 for each later read. So caching pays off as soon as the same prefix is used twice within the cache lifetime, and the savings approach 90% at high reuse.
OpenAI is different
OpenAI caches automatically for prompts of 1,024 tokens or more and charges nothing extra to write. The discount on cached input varies by model, from half price to a tenth:
| Model, per million tokens | Input | Cached input | Discount |
|---|---|---|---|
| gpt-5 | $1.25 | $0.125 | 90% |
| gpt-5-mini | $0.25 | $0.025 | 90% |
| gpt-4.1 | $2.00 | $0.50 | 75% |
| gpt-4o-mini | $0.15 | $0.075 | 50% |
There is no write penalty, so the only question is how much of your input hits the cache. Keep the static part of the prompt first and identical.
How to tell which way your traffic goes
1. Separate cache reads and writes
Both providers return cached and cache-write token counts in each response. Total them per service: if writes are close to reads, the cache is expiring before it's reused.
2. Look at the time between requests
A service handling one request every ten minutes will rarely hit a five-minute cache. A chat assistant with steady traffic almost always will.
3. Compare cost per request before and after
Turn caching on for one service and compare its average cost per request over the same hours of the day. Alye shows cache reads and writes separately for every call and service, so this takes minutes. See Claude cost tracking and OpenAI cost tracking.
Prices are list prices on the date of this post, from our model price list. Check your provider's pricing page for current rates.