GPT-5 vs Claude Opus 4.8: price, coding results, and context

Opus 4.8 costs four times more than GPT-5 on input and scores 14 points higher on SWE-bench. Here's when that trade-off makes sense — and when it doesn't.

By benchr Editorial Team · · Figures verified against official sources, July 24, 2026 · View changelog

GPT-5 input / 1M OpenAI · released Aug 2025
Opus 4.8 input / 1M Anthropic · released May 2026
GPT-5 SWE-bench official OpenAI figure
Opus 4.8 SWE-bench official Anthropic figure

Side-by-side specs

GPT-5 vs Claude Opus 4.8 — figures from official provider documentation
DimensionGPT-5Claude Opus 4.8
ProviderOpenAIAnthropic
ReleasedAug 7, 2025May 28, 2026
Input / 1M$1.25$5.00
Output / 1M$10.00$25.00
Cached input / 1M$0.125 (90% off)$0.50 (90% off)
Context window400,000 tokens1,000,000 tokens
Max output128,000 tokens128,000 tokens
SWE-bench Verified74.9%88.6%
GPQA Diamondnot published93.6%
Fast modeNoYes — $10/$50, ~2.5× speed

Cost for an example workload

At 10 million input tokens per month — a moderate agentic workload — you're spending $12.50 on GPT-5 or $50 on Opus 4.8. That $37.50/month difference is $450/year. At production scale of 500M input tokens monthly, it's $7,500 vs $30,000.

Both models discount cached input by 90%: GPT-5 charges $0.125/1M and Opus 4.8 charges $0.50/1M. Once cached, a reusable 40,000-token prefix costs $0.005 per GPT-5 call versus $0.02 per Opus call. Caching preserves GPT-5's 4× input-price advantage for large, static prompts. Model your actual cache-hit rate and output mix before budgeting.

How to interpret the coding results

SWE-bench Verified presents real GitHub issues from open-source Python repositories. The model must read the issue, understand the code, write a fix, and pass the existing tests — no scaffolding, no hints. At 88.6%, Opus resolves roughly 88 of 100 issues without human intervention. GPT-5 resolves about 75.

That gap matters most when humans are out of the loop. If you're running a CI bot that autonomously applies model-generated patches, those 13 additional failures per 100 issues translate directly to broken builds or manual cleanup. At 200 automated PRs per day, that's 26 more failures requiring engineer attention. At $30 per engineer-hour, the math moves fast.

Outside fully automated code repair, the gap gets much smaller. GPT-5 handles functions from a spec, docstrings, and unfamiliar-code explanations well enough for most teams. The Opus premium pays for more autonomous work, not routine assistance.

Context window: when 400K isn't enough

For most production workloads, GPT-5's 400K-token context is sufficient. Where it bites: entire codebases, long legal contracts, multi-session agent memory, or document analysis jobs that want to fit everything in at once. Opus 4.8's 1M-token context handles all of these without truncation. If your use case regularly approaches 300K tokens, this is a functional constraint, not a spec comparison.

Workloads to evaluate on each model

Go with GPT-5 if: you're building customer-facing chat, document summarization, RAG pipelines, or coding tools where a developer reviews every suggestion. The price advantage is real and GPT-5 covers the vast majority of everyday AI workloads competently.
Go with Opus 4.8 if: you're running autonomous code repair, building a CI pipeline that ships model-generated patches, doing production-scale code review, or any task where model failures are expensive and you need the highest-accuracy option available.

Frequently asked

Can I use GPT-5 and Opus 4.8 in the same pipeline?

Yes, and it often makes sense. Route simple classification, summarization, or first-pass drafts to GPT-5. Escalate only complex, high-stakes, or failure-prone tasks to Opus 4.8. This lowers average cost while preserving quality where it matters. The two APIs are compatible enough that routing logic is straightforward.

Does Opus fast mode change the comparison?

Fast mode runs at $10/$50 per million tokens at ~2.5× standard speed — 8× GPT-5's input price. For latency-critical tasks that specifically require Opus-tier quality, fast mode is a real option. For pure cost efficiency, GPT-5 still wins by a wide margin even against fast mode.

Which is better for writing and analysis, not just coding?

For writing, summarization, reasoning tasks, and analysis, the performance gap narrows. GPT-5 handles these well and at a fraction of the price. Opus 4.8's documented advantages are most pronounced on coding (SWE-bench) and hard reasoning (GPQA), where the benchmarks most closely mirror real performance.

Changelog

  • — Corrected GPT-5 cached-input pricing to $0.125/1M and updated the caching comparison.
  • — Published. All prices and benchmarks verified against official OpenAI and Anthropic documentation.

Sources

  • OpenAI GPT-5 model documentation — pricing and prompt-caching support (verified July 24, 2026)
  • Anthropic API pricing — docs.anthropic.com (verified June 3, 2026)
  • Anthropic fast mode pricing — anthropic.com/news/claude-opus-4 (verified June 3, 2026)
  • benchr model-figures.json — single source of truth, accessed July 24, 2026