Prompt Caching Calculator
Sending a 10,000-token prompt prefix 100 times to Claude Sonnet 5.5 with 500 new input and 300 output tokens per call costs $2.40 without caching and $0.52 with the 5 minute cache, a 78% saving that starts from call 2 (prices checked 2026-10-16).
How to use
- Pick a model and, for Claude, the cache lifetime: 5 minutes or 1 hour.
- Enter the tokens that repeat in every call (system prompt, documents, tool definitions), the tokens that change per call, the output tokens and the number of calls.
- Set how many times the cache is written. Use 1 if calls arrive before the cache expires, more if it expires and is written again. Read the saving, both totals and the break-even call count.
How it works
Without cache = calls × (repeated + changing tokens) × input price + calls × output tokens × output price, all ÷ 1,000,000.
With cache = writes × repeated tokens × write price + (calls − writes) × repeated tokens × cache read price + the same changing-input and output cost.
Write price = input price × multiplier: Claude 1.25 for the 5 minute cache and 2 for the 1 hour cache, OpenAI 1.25 on GPT-5.6 and later and 1 on earlier models, Gemini implicit caching 1.
Break-even calls = 1 + the smallest number of reads r with r × (input price − read price) > (multiplier − 1) × input price. Prices are US dollars per million tokens.
FAQ
When does prompt caching pay off?
On Claude with the 5 minute cache it pays off from the second call that reads the cache, because a read costs a small fraction of the input price and the write surcharge is only 25%. The 1 hour cache costs twice the input price to write, so it needs one more read to break even.
Does OpenAI charge for cache writes?
Caching is automatic on OpenAI. According to the OpenAI prompt caching guide, GPT-5.6 and later models charge 1.25 times the input price for cache writes, and earlier models have no extra write charge.
What about Gemini?
Gemini 2.5 and newer models cache implicitly and pass on the saving when a request hits the cache, so writes are priced as normal input here. Explicit caches also charge storage per million tokens per hour, which this page leaves out.
Why might my real saving be lower?
Each vendor has a minimum cacheable prompt length, the cache only matches an identical prefix, and an expired cache must be written again. Use the writes field for expiries and check the usage numbers the API returns.