AI API Cost Calculator

Calculate and Compare
AI API Costs

Estimate your AI spending, compare model pricing, and understand what your real-world workloads actually cost.

11Pricing guides
8Models in calculator
Oct 2026Prices verified

Cache Write Pricing: The Surcharge You Pay Before Prompt Caching Saves You Anything

Cache Write Pricing: The Surcharge You Pay Before Prompt Caching Saves You Anything

Prompt caching is sold as a 90% discount, and the discount is real — but it is the second price on the bill, not the first. Before a single cached token is read back at the cheap rate, the provider charges you to write the cache, at 1.25 times the normal input price for a short-lived cache and two to two-and-a-half times for a long-lived one. If the cached prompt is never read again, or only after the cache has expired, you paid more than if you had never turned caching on at all. The discount is real. So is the entry fee.

Caching has two prices, not one

Every caching story quotes the read price: cached tokens at a tenth, or a twentieth, of the standard input rate. Almost nobody quotes the write price — it sits in a different column of the pricing page. The first time you send a prompt, the provider processes it at the normal input rate and stores the result — and that storage step is billed separately, as cache write tokens. Every later call that reuses the same prompt pays the cheap cache read rate instead. One price to put the prompt in the fridge, a much lower price to take it out again.

Both providers publish the write price openly. Anthropic states it as multipliers: a 5-minute write costs 1.25 times base input, a 1-hour write twice, and a cache read a tenth — a twentieth on Opus 5.5 and Sonnet 5.5. OpenAI lists it per model: a 30-minute write is 1.25 times input, a 12-hour write 2.5 times, and a cached read 5 percent of input. Same idea, different numbers.

Per 1M tokensBase inputShort writeLong writeCached read
GPT-6.1 Sol (OpenAI)$2.00$2.50 (30 min)$5.00 (12 hr)$0.10
Claude Sonnet 5.5 (Anthropic)$2.00$2.50 (5 min)$4.00 (1 hr)$0.10

The pattern holds across each provider's whole model line: short writes are always 1.25 times base input; the long write is 2.5 times on OpenAI, twice on Anthropic. The workhorse models above are the ones most developers run, so the rest of this article prices everything on them. Our prompt caching guide shows how to win the read discount; this article is about the price you pay before it does.

The break-even math on a 100,000-token prompt

Take a coding assistant with a 100,000-token system prompt and repository context, sent unchanged on every call. Uncached, that prompt costs 100,000 × $2.00 ÷ 1,000,000 = $0.20 per call on either workhorse model.

On a short-lived cache, the first call writes the prompt at $2.50 per million tokens: 100,000 × $2.50 ÷ 1,000,000 = $0.25. Each later read costs $0.01. So the write plus one read is $0.26, against two plain calls at $0.40. You are ahead after a single read — exactly as Anthropic's pricing page promises.

On Anthropic's 1-hour cache, the first call writes at $4.00 per million: $0.40 for the same tokens. Reads are still $0.01, so the write plus two reads is $0.42 against three plain calls at $0.60 — ahead after two reads, as Anthropic publishes. On OpenAI's 12-hour cache the write is $5.00 per million, so the first call costs $0.50; the write plus two reads is $0.52 against three plain calls at $0.60 — it also breaks even after two reads, but the first call costs two and a half times a plain call.

Notice the sting in every one of those sums. The write alone is always dearer than the plain call it replaces: $0.25 instead of $0.20 on a short cache, $0.40 or $0.50 instead of $0.20 on a long one. Caching is a bet that the same prompt will be reused inside the cache lifetime, placed again each time the entry expires. Win the bet and the read discount swamps the write fee within one or two calls; lose it and you paid a premium for nothing.

Three ways the write fee makes your bill worse

The first way is the one-shot document. Send a 200,000-token contract through Claude Sonnet 5.5 once, with caching left on, and the 1-hour write costs 200,000 × $4.00 ÷ 1,000,000 = $0.80. The same tokens as plain input cost $0.40 — you doubled the input bill on a prompt never read again. Even the 5-minute write costs $0.50 against $0.40, a 25 percent surcharge for a feature that saved nothing. If a prompt is used once, the write fee is pure loss, and the loss grows with the size of the prompt.

The second way is sparse traffic and an expiring cache. Picture a support chatbot where sessions arrive minutes apart and the cache lifetime is five minutes. The cache expires between requests, so every call writes the prompt again at 1.25 times input and no call ever gets a read. At 1,000 calls a day on the 100,000-token prompt, that is 1,000 × $0.25 = $250 a day against $200 uncached — $50 a day, $1,500 a month, extra. The same traffic on OpenAI's 12-hour write is worse: 1,000 × $0.50 = $500 a day against $200 uncached, two and a half times the plain bill, for a feature marketed as a discount. A cache lifetime has to match your traffic rhythm: a five-minute cache on traffic that arrives every ten minutes is not a discount, it is a 25 percent surcharge on every call.

The third way is the churning prefix. Caches match on the exact prefix of the prompt, so change anything near the top and the match breaks — the whole block is written again at the write price. A prompt that starts with a timestamp, a rotating date, or a per-user greeting never matches anything: every call pays the write fee and none ever gets a read. Appending to the end is fine — only the new tokens are written — but anything that rewrites the beginning re-buys the entire cached block at 1.25 to 2.5 times the input rate, on every call. If your template puts something unique first, caching is silently charging you extra on every request.

Gemini charges rent instead of a write fee

Google does the same job with a different mechanism, and it changes where the trap sits. On Gemini 4 Argon, caching is implicit only: Google decides what gets cached, and cached reads cost $0.10 per million tokens against a $2.00 input price through November 30, 2026 ($0.20 against $4.00 from December 1). There is no write surcharge to watch for — but no control over what is cached or for how long, either.

On Gemini 3.8 Flash, the charge is storage rent: $0.50 per million tokens per hour to keep a cache alive through December 31, 2026, doubling to $1.00 from January 1, 2027. A 200,000-token cache held for a day costs 0.2 × $0.50 × 24 = $2.40 in storage alone, before a single read — $4.80 a day from January. The reads are cheap, at $0.075 per million tokens, but the meter runs while the cache sits idle. Three providers, three mechanisms, one lesson: the cheap read always has a price attached before it, whether that price is a write fee or rent.

How to tell whether caching is helping you

Start by logging write tokens and read tokens as separate columns, not one total. Anthropic's usage object reports them as cache_creation_input_tokens and cache_read_input_tokens; OpenAI reports cached tokens in prompt_tokens_details.cached_tokens. Our cost-tracking middleware tutorial shows how to log one line per call with the full usage breakdown — extend it to record cache writes and reads separately, and the question answers itself.

Then run this test over a week of traffic for each feature: add up what the writes cost and what the reads saved against plain input pricing. If the writes cost more than the reads saved, caching is losing money on that feature — turn it off there and keep it where it wins. The ratio that matters is reads per write, and the thresholds are now yours to check: one read repays a short write, two repay a long one. Anything below that is a surcharge with a discount label on it.

Finally, match the lifetime to the traffic: a busy endpoint with the same prompt repeated inside minutes wants the short cache; a quiet endpoint where calls arrive hours apart wants no cache at all, unless the reads are guaranteed. And before assuming the 90 percent headline applies to your workload, run your own prompt size and daily call count through our AI API Cost Calculator — the same habit behind our per-user spending guard and the reasoning-token investigation.

The 90 percent discount is real, and for the right workload it is the biggest saving on the bill. But it is a discount on reads, and reads are the second half of the transaction. The first half is a write at a premium: 25 percent more for a short cache, double or two and a half times for a long one. Count the writes, match the lifetime to your traffic, and caching pays for itself in a single read. Skip that, and the discount feature quietly becomes the most expensive line on the invoice.

Rates verified 6 November 2026 on OpenAI's API pricing page, Anthropic's Claude Platform pricing documentation, and Google's Gemini API pricing page. All worked figures are arithmetic on those published rates. Our Claude vs GPT comparison covers the same two models tier by tier.

Popular posts from this blog

DeepSeek API Pricing Explained: What a Chatbot Actually Costs in 2026

OpenAI API Pricing Explained: Every Model, Every Hidden Cost

Claude Opus 5.5 API Pricing: Per-Token Costs and Workload Math