Gemini vs Claude coding comparisons all print the same table, and three of its columns are not the same measurement. On 2026-08-18 we took one real session — three committed files from this repository, 354,835 prompt tokens, measured by Claude Code itself — and priced it on both vendors' published cards. The metered gap came out at roughly 110x in Google's favour, and it is not a real gap: Anthropic charges a one-time fee for the cache and Google charges rent, and the two cross at 53 minutes.
Key takeaways
- The metered comparison is a fee against a rent. Anthropic billed $1.301372 once for a one-hour cache TTL. Google rents the same 325,343 tokens at $1.464044 per hour, so the comparison reverses after 53 minutes of session life.
- A real coding session lands 1.77x over Google's 200k tier. Above it, Gemini 3.1 Pro's rate is exactly 2.00x the headline rate every roundup quotes.
- Both windows are "1M" and neither is. Google publishes 1,048,576 tokens; Anthropic publishes 1,000,000 — 4.86% apart.
- The 2x output-ceiling gap disappears when you check one side. Anthropic's card says 128,000; Claude Code reported 64,000 for the same model, just under Google's published 65,536.
- One of these prices has an expiry date. Gemini 3.7 Flash doubles on 1 January 2027, published on the rate card. Anthropic publishes no scheduled change for the models here.
The short answer
Choose on how long your sessions live, not on the per-token column. Short, bursty, mostly-uncached work is cheaper on Gemini by a wide margin. Long agentic sessions that hold a large cached context — the shape most terminal coding agents actually produce — erase that margin and then cross it.
Everything below is a cost and specification comparison, and deliberately not a quality one. For where the whole field sits, the complete comparison of AI coding assistants is the pillar; for the same problem across nine cards rather than two, what the price cards actually say is the wider version.
One measured session, priced on both cards
The session is deliberately boring: a lockfile and two project documents, all committed, piped into a single headless turn whose entire output was the word "ok".
cat package-lock.json roadmap.md content-rules.md | claude -p "Reply with exactly: ok" --output-format json --effort low --model sonnet # → 696,820 bytes in # → "cache_creation_input_tokens": 325343, "cache_read_input_tokens": 29490 # → 354,835 context tokens, total_cost_usd 1.960971
The comparison is committed as scripts/check-vendor-parity.mjs:
npm run check:parity
| Priced on | Cost |
|---|---|
| Claude Sonnet 5, flat rate | $1.307322 |
| Gemini 3.1 Pro, headline rate | $0.005950 |
| Gemini 3.1 Pro, rate that applies | $0.011876 |
Two things about that table are wrong in ways worth separating. The first is that the middle row is the rate almost every published comparison quotes, and it is not the rate this session would pay. The second is bigger: the Gemini rows do not include the cache at all, because Google does not publish a per-write fee to include.
A fee is not a rent
Anthropic bills a cache write: 325,343 tokens at $4 per million for a one-hour TTL, $1.301372, once. Google bills cache storage: the same tokens at $4.50 per million tokens per hour, $1.464044 for every hour you hold them.
Those are different kinds of number and no single column can hold both. Set them equal and you get the only figure in this article that actually decides anything:
Anthropic write fee $1.301372 one-time, 1-hour TTL
Google storage rent $1.464044 per hour held
─────────────────────────────
crossover 53 minutes
Under 53 minutes of cached-context life, Gemini is cheaper and the metered table is roughly right. Past it, Google's rent overtakes Anthropic's fee and keeps going, and the direction of the comparison inverts while every published table still says 110x.
This matters more for coding than for anything else, because an agentic session is exactly the workload that holds a large context for a long time. A developer who leaves a terminal agent open over lunch is paying Google for lunch and paying Anthropic nothing extra.
Adding OpenAI to the same session makes the shape clearer rather than muddier: priced across all three vendors, Gemini's total overtakes Claude Opus 5 at 80 minutes rather than 53, because that comparison measures full session cost against a more expensive flat card instead of a fee against a rent.
The 200k boundary is not an edge case
Gemini 3.1 Pro's rate card has two columns. Below 200,000 prompt tokens it is $2.00 in and $12.00 out. Above it, $4.00 and $18.00. Anthropic has no such tier; its rate is flat at any prompt length.
The measured session was 354,835 tokens — 1.77x the boundary, and the rate that applied was exactly 2.00x the headline. Nothing about it was contrived: it is three files from one small Next.js site, and an agent asked to understand the project would plausibly open all three. package-lock.json alone measured 139,640 tokens, which is why — the detail is in what actually fills a context window.
So the tier is not the exception in agentic coding. It is closer to the default, and quoting the sub-200k rate for a coding workload is quoting the wrong half of the card.
Gemini vs Claude coding on the spec sheet
Read on 2026-08-18 from each vendor's own documentation:
| Field | Claude Sonnet 5 | Gemini 3.1 Pro |
|---|---|---|
| Context window | 1,000,000 | 1,048,576 |
| Max output, published | 128,000 | 65,536 |
| Max output, tool reports | 64,000 | not installed here |
| Prompt-length tier | none | 200,000 |
| Cache write | $4/MTok | not published |
| Cache storage | not billed | $4.50/MTok/hour |
| Availability | generally available | preview |
Two rows deserve reading twice.
The windows. Both are sold as one million tokens. Google's is 1,048,576 — a power of two — and Anthropic's is a round 1,000,000. The 4.86% difference is real, it is in Google's favour, and it is far too small to decide anything.
The output ceilings. On the cards this looks like Anthropic winning 2x. But Claude Code 2.1.234 reported a 64,000-token ceiling for Claude Sonnet 5 on the sessions measured here, which is slightly below Google's published 65,536. A 1.95x advantage on paper becomes a rounding error the moment one side is checked against a tool, and we could only check one side. Anthropic separately documents 300,000 output tokens on the Batches API behind an output-300k-2026-03-24 beta header, which is a third number again and not the one a coding session gets.
And one of them is a preview. gemini-3.1-pro-preview is labelled preview on Google's own model page; claude-sonnet-5 is generally available. Comparing a preview model to a GA one is a comparability problem in its own right, and it is the kind of thing that vanishes when a table prints only names and numbers.
One of these prices has an expiry date
Google's rate card carries scheduled increases in its own cells. Gemini 3.7 Flash reads "$0.75 through December 31, 2026. $1.50 starting January 1, 2027" on input, with output going $3.75 to $7.50 and cache storage $0.50 to $1.00 per million token-hours.
That is a published doubling on a known date, and it is the sort of fact a roundup written today will be silently wrong about in January. Anthropic publishes no scheduled change for any model compared here.
We made it a failing check rather than a sentence: check:parity carries the effective date, and exits non-zero once the date passes without the card being re-read. It is the same discipline the nine-card price check uses, and the reason this site's pricing claims carry a read date at all.
What we could not measure, and did not estimate
Claude Code is installed on this machine. No Gemini CLI is. So every Google figure above is a published one and every Anthropic figure marked "tool reports" is a measurement, and that asymmetry is printed in the script's output rather than smoothed over.
Three specific consequences:
- No output-quality ranking. We cannot run both, so we do not rank both. This is the same refusal the Claude vs GPT comparison made, for the same reason, and the preconditions it defined are still unmet here.
- Google's delivered output ceiling is unverified. 65,536 is what the page says. Whether a real session gets it is not something this machine can answer, and the row says "not installed here" rather than assuming.
- Google's cache behaviour is priced, not observed. The $4.50 per million token-hours is from the rate card. We did not watch a bill accrue.
The one Anthropic figure we did verify independently is worth stating, because it is a correction. Priced at Anthropic's published $2/$10 rates, the session comes to $1.307322. Claude Code billed $1.960971 — exactly 1.500x, the ratio you get from $3/$2. That reproduces what the Sonnet and Opus comparison found on a much smaller turn: the tool bills Sonnet 5 at $3/$15, not the published $2/$10. This session's cache write was 325,343 tokens against that one's 11,054 — 29x the shape, and the same 1.5x discrepancy to six decimal places.
How to choose between them
- Time your sessions before you price them. If your cached context routinely lives past an hour, price Google's storage rent and not its token rate. Under 53 minutes on this shape, the metered comparison is fair.
- Price the tier you will actually be in. For agentic coding that is usually the above-200k column, which is 2.00x the one that gets quoted.
- Ignore the context-window row. A 4.86% difference between two million-token windows will never be the reason a project succeeds or fails.
- Check the output ceiling in your tool, not on the card. One vendor's card was 2x its own tool's answer here.
- Re-read both cards on a schedule, and make the schedule fail loudly. One of these vendors has already announced that a price doubles in 136 days.
Common mistakes comparing these two
- Putting one $/MTok column next to another. Tempting because both vendors publish one. The symptom is a 110x gap that reverses under a stopwatch. The fix is pricing a real token shape, cache terms included.
- Quoting the headline Gemini rate for coding work. Tempting because it is the first number on the page. The symptom is a bill twice your estimate. The fix is measuring your session's prompt length once — ours was 1.77x over the boundary.
- Treating "1M context" as one specification. Tempting because both say 1M. The symptom is a comparison that turns on 48,576 tokens nobody will notice. The fix is comparing what the tool reports, not what the marketing rounds to.
- Ranking coding quality from one side. Tempting because the reader wants a winner. The symptom is a recommendation with no measurement under it. The fix is saying which tool you have installed and refusing the rest.
Conclusion
Price the session, not the token. If your work is short and bursty, Gemini 3.1 Pro is meaningfully cheaper and the published gap is roughly honest; if it is long-running agentic coding on a large repository, Google's cache rent overtakes Anthropic's cache fee after 53 minutes and the above-200k tier doubles the rate you were quoted. Run npm run check:parity against your own measured session before committing either way, and if quality is the deciding factor, note that neither this article nor any comparison written on one installed tool can settle it.
Frequently asked questions
Is Gemini cheaper than Claude for coding?
What is Google's 200k token pricing tier?
Does Gemini or Claude have a bigger context window?
Which model has a bigger output limit, Gemini 3 or Claude?
Can you compare Gemini and Claude on coding quality?
Muhammad Kashif
Founder and editor of Devventa, covering AI coding assistants, Next.js and the modern AI development stack.




