Gemini vs Claude API Cost 2026

Complete pricing comparison — Gemini 2.5 Pro, 2.5 Flash & 2.0 Flash vs Claude Sonnet 4.6, Haiku 4.5 & Opus 4.7. Find which model is cheapest for your workload.

Quick Verdict — Which Wins?

Gemini wins

Raw token price (fast & mid tier)

Gemini 2.5 Flash ($0.15/$0.60/M) and Gemini 2.0 Flash ($0.075/$0.30/M) are dramatically cheaper per token than Claude Haiku 4.5 ($0.80/$4/M) or Sonnet 4.6 ($3/$15/M) at list rates.

Gemini wins

Free tier & prototyping

Google AI Studio offers a generous free tier for Gemini 2.0 Flash and 2.5 Flash. Anthropic has no equivalent free API tier — all Claude API access requires payment.

Claude wins

Caching-heavy workloads

Claude's cache reads cost ~10% of input price (90% off). Gemini's context caching is 75% off. For large repeated system prompts, Claude's deeper cache discount can close the gap significantly.

Claude wins

Agentic coding & tool use

Claude Sonnet 4.6 powers Claude Code, Cursor's Claude mode, and most AI coding tools. It consistently outperforms Gemini on complex multi-step coding and instruction-following benchmarks.

Full Pricing Table — Gemini vs Claude (per million tokens)

All prices are input / output per million tokens as of 2026. Cache rates apply to repeated context (system prompts, long document chunks). Gemini context cache has minimum 32K tokens and a storage fee; Claude's prompt cache has no minimum or storage cost.
Model Provider Input /M Output /M Cache Read /M Cache Discount Context Window
Gemini 2.0 Flashfastfree tier Google $0.075 $0.30 $0.019 75% off 1M tokens
Gemini 2.5 Flashfastfree tier Google $0.15 $0.60 $0.0375 75% off 1M tokens
Claude Haiku 4.5fast Anthropic $0.80 $4.00 $0.08 90% off 200K tokens
Gemini 2.5 Prosmart Google $1.25 $5.00 $0.3125 75% off 2M tokens
Claude Sonnet 4.6smart Anthropic $3.00 $15.00 $0.30 90% off 200K tokens
Gemini 2.5 Pro (200K+)smart Google $2.50 $10.00 $0.625 75% off 2M tokens
Claude Opus 4.7best Anthropic $15.00 $75.00 $1.50 90% off 200K tokens
Gemini 2.5 Ultrabest Google $5.00 $15.00 $1.25 75% off 2M tokens

Context Window: Gemini's Major Advantage

Gemini 2.5 Pro's 2,000,000-token context window (2M) dwarfs Claude's 200K. This matters for whole-codebase analysis, large document sets, and multi-hour conversation history.

ModelContext WindowRelative Size
Gemini 2.5 Pro 2,000,000 tokens (~1,500 pages)
Gemini 2.0 Flash 1,000,000 tokens (~750 pages)
Claude Sonnet 4.6 200,000 tokens (~150 pages)
Claude Haiku 4.5 200,000 tokens (~150 pages)

Caveat: longer contexts cost more. Sending 2M tokens to Gemini 2.5 Pro costs $2.50 per call at standard rates — you'll want caching for any repeated content.

Caching: Where Claude Closes the Gap

Both providers offer context/prompt caching, but with different discount structures and mechanics:

Provider Cache Discount Cache Read Price (Sonnet-tier) Min Cacheable Context Storage Fee
Anthropic (Claude) 90% off input $0.30/M (Sonnet 4.6) 1,024 tokens None
Google (Gemini) 75% off input $0.3125/M (2.5 Pro) 32,768 tokens $1.00/M tokens/hr

Surprising result: At the mid-tier, Claude Sonnet 4.6 cached ($0.30/M) and Gemini 2.5 Pro cached ($0.3125/M) are nearly identical in cache read cost — despite Claude costing 2.4× more at standard rates. If your workload is heavily cached and mid-tier quality, both models end up at similar effective cost.

Cost Calculator — Compare Gemini vs Claude for Your Usage

Compare API costs for your workload

When to Choose Gemini Over Claude

Choose Gemini when:

Choose Claude when:

Frequently Asked Questions

Is Gemini cheaper than Claude?

On raw per-token rates, yes — significantly. Gemini 2.5 Flash ($0.15/$0.60/M) is about 20× cheaper input and 25× cheaper output than Claude Sonnet 4.6 ($3/$15/M). Even at the mid-tier, Gemini 2.5 Pro ($1.25/$5/M) is 2–3× cheaper than Sonnet 4.6. However, Claude's 90% prompt cache discount (vs Gemini's 75%) can narrow this gap for caching-heavy workloads — and Claude's cache minimum is just 1,024 tokens vs Gemini's 32K, so small prompts can be cached with Claude but not Gemini.

Does Gemini have a free tier?

Yes. Google AI Studio provides free access to Gemini 2.0 Flash, Gemini 2.5 Flash, and Gemini 2.5 Pro with rate limits. Gemini 2.0 Flash free tier allows ~1,500 requests/day. Anthropic has no equivalent free API tier — all Claude API use requires a paid account. For prototyping, hobby projects, or low-volume apps, Gemini's free tier is a significant advantage.

How does Gemini 2.5 Pro context window compare to Claude?

Gemini 2.5 Pro supports a 2,000,000 token (2M) context window — 10× larger than Claude Sonnet 4.6's 200K limit. For most applications (chatbots, coding assistants, document Q&A), 200K is sufficient. But for whole-repository analysis, very long documents, or extensive conversation history, Gemini's 2M window is a real advantage. Note that sending large contexts costs proportionally more — always cache repeated content.

Is Claude or Gemini better for coding?

Claude Sonnet 4.6 leads on complex agentic coding benchmarks and is the model behind Claude Code, Cursor's Claude mode, and many AI coding tools. Gemini 2.5 Pro has strong coding capabilities — especially for Python, data science, and notebook-style tasks — and may outperform Sonnet on some benchmarks. For multi-step autonomous coding with tool use, Claude's track record is stronger. For one-shot code generation or simpler tasks, the gap is smaller and Gemini's lower cost may make it the better choice.

Which is better for production apps — Gemini or Claude?

Both are production-ready. The decision usually comes down to: (1) cost at your volume, (2) caching requirements, (3) context window needs, and (4) which model gives better quality for your specific task. Run the calculator above with your actual token counts and cache hit rates to get a realistic cost estimate before committing to either provider.

How do I estimate my Claude or Gemini API costs?

Use the calculator above for API cost estimates based on token counts. For Claude Code users, paste your session log into the Claude Code Cost Calculator to see your exact cost breakdown by model, tool, and hour — including cache savings.

Calculate Your Actual Claude Code API Cost

Paste your Claude Code session log to get a precise cost breakdown — by model, by tool, by hour. See your real cache savings and compare to Gemini at your actual token volumes.

Open Cost Calculator →