Claude Sonnet 4.6 vs GPT-5: price, context, and coding results

Sonnet costs 2.4× more on standard input and buys a higher coding score and a 1M context; GPT-5 is cheaper on both standard and cached input.

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

Sonnet 4.6 input / 1MAnthropic · output $15
GPT-5 input / 1MOpenAI · output $10
Sonnet SWE-benchVerified, official
GPT-5 SWE-benchVerified, official

Both models sit below their providers' higher-priced tiers and are positioned for sustained API use. The listed prices, context limits, and reported benchmark results differ, but none of those fields shows production reliability by itself. Compare them on the same prompts, tool calls, and acceptance criteria.

Side-by-side specs

Claude Sonnet 4.6 vs GPT-5 — verified figures, July 24, 2026
DimensionClaude Sonnet 4.6GPT-5
Input / 1M$3.00$1.25
Output / 1M$15.00$10.00
Cached input / 1M$0.30$0.125
Context window1,000,000400,000
Max output64,000128,000
SWE-bench Verified79.6%74.9%
Throughput (benchr est.)95 tok/s90 tok/s

GPT-5 stays cheaper when you cache

Both models discount cached input by 90%: Sonnet charges $0.30/1M and GPT-5 charges $0.125/1M. For an agent with a reusable 40K-token system prompt, that prefix costs $0.012 per Sonnet call versus $0.005 per GPT-5 call once it is cached. Stateless, short-prompt workloads stay on the standard $3 and $1.25 input rates instead. Run your own mix through the cost calculator.

A concrete workload

Take a code-review bot: 15K input tokens (diff + context), 3K output, and 20,000 runs a month. Without caching, GPT-5 costs $975/month and Sonnet 4.6 costs $1,800/month. If 10K input tokens are a stable cached prefix, the totals fall to roughly $750/month on GPT-5 and $1,260/month on Sonnet.

The remaining difference is about $510 a month for a 4.7-point gap in the cited SWE-bench figures. That benchmark alone cannot tell you whether the premium reduces missed bugs in your review queue, so measure accepted reviews and developer corrections.

Workloads to test for each model

Sonnet 4.6 has the higher cited SWE-bench figure and a context window above 400K. GPT-5 has the lower standard and cached input price, the larger listed output limit (128K vs 64K), and may require less integration work in a stack already using OpenAI API shapes. Choose against your token mix and representative repository tasks; the Sonnet review provides broader context.

Frequently asked

Is Claude Sonnet 4.6 worth 2.4 times GPT-5's input price?

When the work is coding or long documents, usually yes. Sonnet 4.6 scores 79.6% on SWE-bench Verified against GPT-5's 74.9%, and its 1M-token context window is 2.5 times GPT-5's 400K. For short, output-light chat and breadth tasks, GPT-5's lower rates win on cost.

Which one is cheaper on a real workload?

It depends on the input/output mix. A task with 10K input and 2K output costs about $0.0325 on GPT-5 and $0.06 on Sonnet 4.6 without caching. With repeated prefixes, both offer 90% discounts: GPT-5 costs $0.125/1M cached input versus Sonnet's $0.30, so GPT-5 remains cheaper.

When does GPT-5's 400K context become the problem?

When a single task needs more than roughly 300K tokens of working material — large codebase slices, long discovery documents, multi-file analysis. Sonnet 4.6 takes 1M tokens in one window; GPT-5 needs chunking and a retrieval layer at that point, which adds engineering cost the price sheet doesn't show.

Changelog

  • July 24, 2026 — Corrected GPT-5 cached-input pricing to $0.125/1M and updated the cache-cost comparison.
  • June 10, 2026 — Expanded from a spec table into a full comparison: cost math on a concrete workload, where each model wins, and a verdict. Page re-indexed.
  • June 6, 2026 — Published as a spec-table stub (noindexed pending expansion).

Sources