Home โ€บ Blog โ€บ OpenAI vs Anthropic vs Gemini after caching

OpenAI vs Anthropic vs Gemini after prompt caching: real cost difference (2026)

Published 15 July 2026 ยท reference prices, verify before budgeting

Every LLM cost comparison you've seen probably ignores caching. That's a mistake โ€” because prompt caching changes the cost ranking. Claude charges a write fee; OpenAI doesn't. Gemini's context caching costs per hour stored. Here's the real math.

Caching mechanisms โ€” how each provider works

ProviderCache typeCache write costCache read costCache TTLMin tokens
Anthropic (Claude)Prompt prefix cache1.25ร— standard input0.10ร— standard input5 min (extendable)1,024
OpenAI (GPT-4o)Automatic cacheNo write fee0.50ร— standard input~5 min1,024
Google (Gemini)Context cacheNo write fee0.25ร— standard inputBilled per hour stored32,768

Key structural differences:

The base prices (without caching)

ModelInput $/1MOutput $/1M
Claude Sonnet 4$3.00$15.00
GPT-4o$2.50$10.00
Gemini 2.5 Pro$1.25$10.00

Without caching: Gemini 2.5 Pro is cheapest on input ($1.25 vs $2.50 vs $3.00). But once caching applies, the picture changes.

The scenario: 10,000-token system prompt, 500 requests/day

A typical production app: you have a 10,000-token system prompt (instructions + context + examples), and you send 500 requests/day. Each request adds 300 tokens of user input and gets 400 tokens back.

Cost without caching (monthly, 15,000 requests)

ModelInput/req (10,300 tok)Output/req (400 tok)Monthly (15k req)
GPT-4o$0.02575$0.004$446
Claude Sonnet 4$0.0309$0.006$550
Gemini 2.5 Pro$0.012875$0.004$255

Cost WITH caching applied (same 15,000 requests/month)

The 10,000-token system prompt is cached. Each subsequent request reads 10,000 cached tokens + 300 new input tokens.

ModelCache read /1MNew input /1MMonthlyvs. no cache
GPT-4o (auto cache)$1.25$2.50$204โˆ’$242 (โˆ’54%)
Claude Sonnet 4 + cache$0.30$3.00$117โˆ’$433 (โˆ’79%)
Gemini 2.5 Pro + context cache$0.3125$1.25$58*โˆ’$197 (โˆ’77%)

*Gemini context cache also charges $4.50/hour for 10k tokens stored. At 1 cache instance running 24/7: +$3.24/month storage cost. Added separately below.

Wait โ€” Claude is cheapest after caching? Yes. At this scale (15k req/month with 10k system prompt), Claude Sonnet 4 with caching costs $117/month vs GPT-4o's $204/month and Gemini's ~$61/month. The 90% cache read discount overwhelms Claude's higher base price when you have a large repeated prefix.

The cache write premium (Anthropic only)

On the first request, Anthropic charges 1.25ร— to write the cache. For a 10,000-token system prompt at $3.00/1M: first request costs $0.0375 vs $0.030 standard. The extra $0.0075 is recovered after just 1.14 cache hits. If you're doing 500 requests/day, that write premium is insignificant. For bursty, low-volume use, it adds up.

Gemini's storage cost trap

Gemini's context cache gives 75% off reads โ€” the biggest discount. But it charges hourly for stored content regardless of traffic. For a 10,000-token cache running 24/7:

For large-context use cases (codebase assistant, document analysis), Gemini's storage cost can erode the cache discount advantage. Calculate both terms before assuming Gemini wins.

The new cost ranking after caching

Without caching: Gemini 2.5 Pro > GPT-4o > Claude Sonnet (cheapest to most expensive)
With caching (large system prompt, high volume): Gemini โ‰ˆ Claude > GPT-4o (Claude catches up dramatically)
With caching (bursty, low volume): GPT-4o > Claude > Gemini (OpenAI's no-write-fee + no-storage-fee wins)

The "cheapest" provider depends on your traffic pattern and prompt structure.

When each approach wins

Use caseBest choiceReason
High-volume app, large fixed system prompt (>2k tokens, >200 req/day)Claude Sonnet 490% cache discount + no storage fee = lowest total at scale
Variable traffic, bursty requestsGPT-4oNo write fee, no storage fee, automatic โ€” most forgiving
Very large context (>32k tokens) at high volumeGemini 2.5 Pro75% cache read discount; storage cost small relative to input savings
Low volume (<50 req/day), small promptGemini 2.0 FlashCaching savings minimal; Flash's raw price wins
Dev/testing, unpredictable usageGPT-4o miniCheapest at low volume; automatic caching with no overhead

The calculation formula

To compare providers with caching for your use case:

# Monthly cost per provider with caching:
cache_tokens = your_system_prompt_tokens
new_tokens = user_message_tokens
output_tokens = average_response_tokens
requests = daily_requests ร— 30

# OpenAI (automatic, no write fee):
monthly = requests ร— (cache_tokens ร— cache_rate + new_tokens ร— input_rate + output_tokens ร— output_rate) / 1_000_000

# Anthropic (explicit, write premium on first req):
first_req = cache_tokens ร— (input_rate ร— 1.25) / 1_000_000 # write premium
rest = (requests-1) ร— (cache_tokens ร— (input_rate ร— 0.10) + new_tokens ร— input_rate) / 1_000_000
output_cost = requests ร— output_tokens ร— output_rate / 1_000_000
monthly = first_req + rest + output_cost

Or just use our cost calculator โ€” set your token counts and the results reflect standard rates (caching applies automatically on the provider's infrastructure).

Reference prices, July 2026. Caching mechanisms and rates change frequently โ€” verify on OpenAI, Anthropic, and Google documentation. Found an error? Report it โ†’