These are the two frontier models with the most complete public benchmark records right now, and they pull in different directions. Claude Opus 4.8 was Anthropic's flagship Opus when this ran, built around coding and agentic work. Gemini 3.1 Pro is Google's frontier preview, cheaper and tuned to win the hardest abstract-reasoning tests. The decision isn't "which is smarter" — it's whether your budget is going toward coding accuracy or toward strong reasoning at a lower price. For each model on its own terms, see the Claude Opus 4.8 review and the Gemini 3.1 Pro review.
The pricing reference first, since it shapes every other decision. Opus 4.8 lists at $5 per million input tokens and $25 output, per Anthropic's pricing page. Gemini 3.1 Pro lists at $2 input and $12 output for prompts up to 200K tokens, per Google's Gemini API pricing. That's roughly 2.5x cheaper on input and about half the output cost — a real gap if you're running volume. Two caveats keep it honest: Gemini's price climbs to $4 input and $18 output above 200K tokens, and its output is capped at 64K versus Opus's 128K.
One housekeeping note before the comparison. Gemini 3.1 Pro shipped in preview on February 19, 2026, and Google flags that its prices and limits may change. Opus 4.8 is a generally available production model. If you're building something that needs stable pricing and rate limits, weight that difference; if you're experimenting, it matters less.
| Spec | Claude Opus 4.8 | Gemini 3.1 Pro |
|---|---|---|
| Price (per 1M, in / out) | $5 / $25 | $2 / $12 (≤200K); $4 / $18 above |
| Context window | 1M tokens | 1M tokens |
| Max output | 128K (300K beta) | 64K (includes thinking) |
| SWE-bench Verified | 88.6 | 80.6 |
| GPQA Diamond | 93.6 | 94.3 |
| Availability | Generally available | Preview (no free API tier) |
Published coding and agent results
Anthropic reports 88.6 on SWE-bench Verified for Opus 4.8, while Google reports 80.6 for Gemini 3.1 Pro. Anthropic also reports 69.2 on SWE-bench Pro and 84.4 on SWE-bench Multilingual. These provider figures do not predict first-pass success or review burden on another repository.
Anthropic reports 83.4 on OSWorld-Verified, 74.6 on Terminal-Bench 2.1, and a GDPval-AA Elo of 1890 for Opus 4.8. Google does not publish a directly comparable Gemini agent suite in the cited record. That missing coverage prevents a head-to-head conclusion; test both models on the same files, tools, and completion criteria.
Published reasoning and science results
Google reports 77.1 for Gemini 3.1 Pro on ARC-AGI-2. Anthropic did not publish an Opus 4.8 figure in the cited material, so this result cannot support a direct comparison.
Google reports 94.3 on GPQA Diamond for Gemini, while Anthropic reports 93.6 for Opus. Without repeated runs under a shared protocol, the 0.7-point difference should not be treated as a practical gap. Google also reports 80.5 on MMMU-Pro and 92.6 on MMMLU for Gemini. Research, science, and multimodal workloads still require the same inputs and scoring criteria on both models.
Price and threshold conditions
For prompts up to 200K tokens, Gemini lists $2 input and $12 output per million tokens, compared with Opus at $5 input and $25 output. Gemini batch rates are $1/$6 below the threshold and $2/$9 above it; Opus batch rates are $2.50/$12.50. Apply those rates to your measured input/output mix rather than treating the listed difference as a total-cost result.
Gemini's price rises above 200K input tokens to $4 input and $18 output, and its 64K output limit includes thinking tokens. Opus lists a 128K output limit, with 300K in beta, plus cache reads at $0.50 per million, batch at half price, and an optional fast mode at $10/$50. These constraints affect different workloads in different ways.
Context and output: same window, different ceilings
Both models carry a 1M-token context window, so for ingesting large codebases, long documents, or sprawling chat histories they're evenly matched on what they can read. The difference is on the way out. Opus 4.8 can produce up to 128K tokens in a single response, with a 300K beta, while Gemini 3.1 Pro tops out at 64K — and because Gemini's output budget includes its thinking tokens, a heavy reasoning pass eats into the room left for the actual answer.
This rarely matters on chat or short generations, where neither model comes close to the ceiling. It bites on the jobs that produce a lot of text at once: a full document draft, a large refactor returned as one diff, an exhaustive structured extraction. If that's your pattern, Opus's output headroom is a concrete advantage that the price comparison alone won't show you.
For the broader frame on how these flagships stack against the rest of the field, the Gemini 3.1 Pro vs GPT-5.5 comparison covers the reasoning-versus-knowledge-work axis, and the Opus 4.8 review goes deeper on where Anthropic's tier earns its keep.
Which one for which work
If you're shipping code or building agents, default to the Opus tier: Opus 4.8 when this comparison ran, Claude Opus 5 now at the same $5 / $25. The Opus 4.8 SWE-bench lead is wide, the agentic and computer-use scores are higher, and there's no Gemini number that contradicts the picture. Coding accuracy is exactly what the $5/$25 premium buys.
If you're running high-volume reasoning, research, or multimodal work and price-per-token drives the decision, Gemini 3.1 Pro is the pick. It's much cheaper, ties or wins on the science and reasoning benchmarks, and leads on multimodal — just keep the 200K price cliff and the 64K output cap in view.
If you can run both, the clean split is Opus for the coding and agent layer, Gemini for the high-volume reasoning and analysis layer. And remember that Gemini is still a preview: stable-pricing-dependent production work leans toward Opus until Gemini graduates to GA.