Prompt caching and batch calculator: what stacks, what doesn't, and what stays unpredictable
On a 20,000-request workload with an 8,000-token prefix, Claude Sonnet 4.5 costs $600 a month at list price. An 85% cache hit rate cuts that to $238.80; adding a 40% batch share cuts it to $191.04. A 70–95% hit-rate range still leaves a $156–$243 bill.
Your workload
Advanced: cache writes and variance range
One cache write per 100 requests gives 100 reuses before expiry. Set writes to 0 if your provider does not charge a write premium.
The prefix is the stable, cacheable part of the prompt. Keep timestamps, request IDs and variable user text after it.
Result Claude Sonnet 4.5
List prices, 19 Nov 2026. The estimate excludes retries, storage, egress and gateway fees. Batch share applies to the whole request; cache hits apply to input only.
The four discount states
| State | Monthly cost | Saving vs list | What changed |
|---|---|---|---|
| No discount | $600.00 | — | All input at the standard rate |
| Cache only (85%) | $238.80 | 60.2% | Cached reads, misses and writes |
| Batch only (40%) | $480.00 | 20.0% | 40% of requests at 50% off |
| Both | $191.04 | 68.2% | Cache first, then batch on the smaller base |
The combined saving is less than 60.2% + 20.0% because batch applies to only 40% of traffic and to the already-discounted cache cost. Discounts multiply; they do not add.
The discount stack, in one paragraph
Prompt caching and batch processing are different discounts on different things. Caching reduces the price of input tokens that repeat across requests. Batching reduces the price of requests you can defer. They can be combined, and when they are, the saving is larger than either alone — but smaller than adding the two percentages together.
The correct model is sequential. First compute the cost of the request with cached and uncached input. Then apply the batch discount to the share of requests that are batched. A 90% cache discount and a 50% batch discount do not produce a 95% saving; on a realistic workload they produce something closer to 60–70%, and the exact number depends on the prefix share, the hit rate and the batch share.
This calculator computes all four states side by side — no discount, cache only, batch only, both — so the contribution of each lever is visible. It then computes the month-to-month range that remains after both, which is the number a finance team actually needs.
Why a cache hit rate is not a discount rate
A “90% cache discount” and a “90% cache hit rate” are different numbers, and confusing them can overstate savings several-fold.
The discount is a property of the price list: cached input costs some fraction of the standard input rate. The hit rate is a property of your traffic: the share of input tokens that actually hit a warm cache. If 90% of your input is cacheable but only 30% of requests hit a warm entry, your effective discount is 30% of 90%, not 90%.
Three things suppress the hit rate in production:
- Cache lifetime. A 5-minute TTL is shorter than the gap between many batch jobs, cron runs and low-traffic endpoints. The cache expires between requests, so every run pays the write again.
- Prefix stability. The cache key includes everything before the variable content. A timestamp, a request ID, a user name or a reordered tool list at the top of the prompt invalidates the whole prefix. Put stable content first and variable content last.
- Routing. A cache is usually scoped to an organization, project or endpoint. Multi-region or multi-provider routing can send consecutive requests to different caches, so the hit rate depends on routing policy as much as prompt design.
The calculator therefore takes the hit rate as an input and shows the sensitivity around it. A single “expected saving” number hides the thing that matters most.
The cache-write payback period
Caching is not free to use. Some providers charge a premium to write a cache entry, and the premium has to be recovered by later reads. Whether it pays depends on how many times the prefix is reused before it expires.
Define m_r as the cached-read price divided by the standard input price, m_w as the cache-write price divided by the standard input price, and N as the number of requests that reuse the same prefix before it expires. The break-even hit rate is:
h* = m_w ÷ (N × (1 − m_r))
For a 0.10× read price and a 1.25× write price:
| Reuses before expiry (N) | Break-even hit rate | Interpretation |
|---|---|---|
| 5 | 27.8% | Short-lived prefix; caching often loses |
| 20 | 6.9% | Works for steady traffic |
| 100 | 1.4% | Works for most production prefixes |
| 1,000 | 0.14% | Long-lived system prompt; almost always worth it |
If a prefix is reused 100 times before it expires, caching pays off even at a 1.4% hit rate. If it is reused five times, you need a 27.8% hit rate to break even. Long-lived, frequently reused system prompts are almost always worth caching. A prefix used twice a day with a 5-minute TTL is not.
This also explains why a cache that “works” can still lose money: the write premium is paid on every cold start, and the reads never accumulate enough to recover it.
Batch is a deferral discount
Batch pricing is simpler than caching: you accept a longer completion window and receive a discount on the whole request. The published terms are similar across the largest providers:
| Provider | Batch discount | Completion window | Stacks with caching? |
|---|---|---|---|
| OpenAI | 50% | Within 24 hours | Confirm per model |
| Anthropic | 50% | Most under 1 hour; 24-hour expiry | Yes, with best-effort cache hits |
| Google Gemini | 50% | 24-hour target | Confirm per model |
The engineering cost is the part the calculator cannot price. A batch job needs a queue, an idempotency key, a result store and a fallback path for expired or failed batches. If the workload is already asynchronous — nightly classification, backfills, evaluation runs, document enrichment — that cost is near zero. If a user is waiting for the answer, batch is not an option at any discount.
What stacking actually does
Take a concrete workload: 20,000 requests a month, an 8,000-token prefix reused on every request, 400 output tokens, Claude Sonnet 4.5 at $3.00 input / $15.00 output / $0.30 cached input / $3.75 cache write. Assume one cache write per 100 requests and a 40% batch share at 50%.
| State | Calculation | Monthly cost |
|---|---|---|
| No discount | 160M input × $3.00 + 8M output × $15.00 | $600.00 |
| Cache only (85%) | 136M reads × $0.30 + 24M misses × $3.00 + 1.6M writes × $3.75 + output | $238.80 |
| Batch only (40%) | $600.00 × (1 − 0.40 × 0.50) | $480.00 |
| Both | $238.80 × 0.80 | $191.04 |
The combined saving is $408.96, or 68.2% off the undiscounted bill. Cache alone saves 60.2%; batch alone saves 20%. The two together save less than the sum (80.2%) because batch only applies to 40% of traffic and because the batch multiplier applies to the already-discounted cache cost.
That is not a trick of arithmetic. It is what “stacking” means: the second discount applies to a smaller base.
The variance nobody models
A discount calculator that returns one number is answering the wrong question. The bill a finance team has to forecast is a range, because the hit rate and the batch share are not constants.
| Cache hit rate | Monthly cost at 40% batch | Change vs 85% |
|---|---|---|
| 70% | $242.88 | +$51.84 |
| 85% | $191.04 | — |
| 95% | $156.48 | −$34.56 |
The range is $86.40 a month on a $191 average — a 45% swing driven entirely by cache behaviour. Add variation in batch share, request volume and output length, and the range widens. A flat plan at $60 is not just cheaper than the average; it is the only option in the comparison that has no range at all.
This is the page's central argument, and it should be made with arithmetic rather than adjectives:
Even at a 95% cache hit rate and a 40% batch share, this workload costs between $156 and $243 a month. Builder is $60, and the invoice does not move when the hit rate does.
The point is not that caching and batch are bad. They are the right optimisation for a per-token bill. The point is that optimisation reduces the level of an unpredictable bill; it does not remove the unpredictability. For a team that needs a forecast it can commit to, that distinction matters more than the discount.
When per-token plus discounts still wins
Honesty improves conversion here. If the workload is small, or runs mostly on the cheapest models, the discounted per-token bill can be below any flat plan. At 20,000 requests and a 95% hit rate on DeepSeek V4 Flash, the bill is a few dollars a month. A $60 plan would be a downgrade.
The decision rule is the same as the cost calculator's: compute the discounted per-token cost, compare it with the plan price, and check the plan's daily caps. Caching and batch change the level; they do not change the shape of the decision.
Where they do change the decision is at scale and at high variance. A workload that spends $1,600–$2,700 a month depending on cache behaviour has a budgeting problem that a 50% batch discount does not solve. That is the customer this page is written for, and the calculator says so plainly.
How to measure your real hit rate
Do not use the provider's marketing number or your own estimate. Measure it:
- Log the cached-token count in the response usage object, or the provider's equivalent, per request. Field names differ by provider and API version.
- Divide cached tokens by total input tokens, per day and per endpoint.
- Segment by endpoint: a chat endpoint with a stable system prompt and a RAG endpoint with per-query context can have wildly different hit rates.
- Compare the hit rate with the cache TTL. If the hit rate is near zero on a workload that should cache, the prefix is probably unstable or the TTL is too short.
- Re-measure after any prompt-template change. A single reordered tool schema can reset the hit rate to zero.
The calculator's sensitivity table is only as good as the range you feed it. Use the observed p10 and p90 of your own hit rate, not a round number.
Cache and batch prices by model
| Model | Input | Cached read | Read multiplier | Cache write | Write multiplier | Batch discount |
|---|---|---|---|---|---|---|
| Claude Sonnet 4.5 | $3.00 | $0.30 | 0.10× | $3.75 | 1.25× | 50% |
| Claude Haiku 4.5 | $1.00 | $0.10 | 0.10× | $1.25 | 1.25× | 50% |
| GPT-5.6 | $4.00 | $0.40 | 0.10× | $5.00 | 1.25× | 50% |
| Gemini 3 Flash | $0.50 | $0.05 | 0.10× | — | — | 50% |
| DeepSeek V4 Flash | $0.15 | $0.003 | 0.02× | — | — | Confirm |
| Mistral Large 4.0.8 | $0.70 | $0.07 | 0.10× | — | — | Confirm |
| Grok 4.3 | $1.25 | $0.20 | 0.16× | — | — | Confirm |
| o3 | $2.00 | $0.50 | 0.25× | — | — | 50% |
| Llama 3.3 70B (Groq) | $0.59 | — | — | — | — | Confirm |
If a model has no cached-input price, the calculator does not model a caching saving for it. “Confirm” means the provider's current batch documentation does not state a discount we could verify for this model; enter your contracted discount if you have one.
Download the dataset
The price and multiplier rows behind this page are available as CSV and JSON, with source and verification dates. CC BY 4.0.
Methodology
Prices are list values from the models.dev catalogue, retrieved 19 Nov 2026. Cache multipliers are derived as cached input ÷ input and cache write ÷ input from those prices, not assumed. Batch discounts are from provider documentation and are dated in the table. The calculation assumes one cache write per 100 requests by default; change the writes input to model a different reuse pattern. The estimate excludes retries, storage, egress, gateway fees, negotiated rates and long-context tiers.
Related: LLM API cost calculator · rate-limit calculator · context-window calculator · RAG cost calculator · AI API pricing tracker · plans and caps.
FAQ
Does prompt caching stack with the Batch API?
On Anthropic, the pricing discounts stack, though cache hits inside a batch are best-effort because requests run asynchronously and concurrently. OpenAI and Google both offer caching and batch discounts, but confirm the combination for the specific model before you plan on it.
What cache hit rate makes caching worth it?
It depends on the write premium and how often the prefix is reused. With a 1.25× write premium and a 0.10× read price, caching breaks even at a 1.4% hit rate if the prefix is reused 100 times before expiry, and at 27.8% if it is reused five times.
Why is my cache hit rate lower than expected?
The three usual causes are an unstable prefix (a timestamp, request ID or reordered tool list near the top), a TTL shorter than the gap between requests, and routing that sends consecutive requests to different caches. Measure cached tokens per endpoint before changing the discount assumption.
Is batch always cheaper?
The per-request price is lower, but batch adds queueing, result storage and a failure path, and it cannot serve interactive traffic. For a nightly backfill it is close to free money. For a chat product it is not an option, regardless of the discount.
Want a bill that does not move when the hit rate does?
Plugsky plans start at $8/month. Builder is $60/month with unlimited fair use, 600 RPM, 10 concurrent requests and a 7-day money-back guarantee. Compare the range above, then check the caps.
See plans and caps → Start free