Verdict: in the Claude Sonnet 4.5 vs GPT-5 comparison, Claude Sonnet 4.5 wins on coding and agentic work, scoring 77.2% on SWE-bench Verified against GPT-5's 74.9% (Anthropic, OpenAI). GPT-5 wins on price, listing at $1.25 input and $10 output per million tokens versus $3 and $15 for Sonnet 4.5, and it leads on competition maths and multimodal understanding. Pick Sonnet 4.5 if your primary workload is writing and refactoring code inside an agent; pick GPT-5 if you are running high token volumes, image-heavy inputs, or maths-flavoured reasoning where the cost difference compounds.
TL;DR
- Coding: Sonnet 4.5 leads on SWE-bench Verified, 77.2% vs 74.9%, and on agentic terminal tasks, 50.0% vs 43.8% (Terminal-Bench leaderboard).
- Price: GPT-5 is roughly 60% cheaper on input and a third cheaper on output per million tokens (OpenAI pricing).
- Maths and multimodal: GPT-5 posts 94.6% on AIME 2025 without tools and 84.2% on MMMU (OpenAI).
- Context: GPT-5 accepts 272K input tokens with a 400K total window; Sonnet 4.5 offers 200K.
- Both are one generation behind the frontier as of mid-2026, which is exactly why they are now the value tier.
- Last verified: 1 September 2026.
Which model wins claude sonnet 4.5 vs gpt-5 for coding?
Sonnet 4.5, and the margin holds across more than one benchmark, which is what makes it worth acting on. Anthropic reports 77.2% on SWE-bench Verified for Sonnet 4.5, using parallel test-time compute (Anthropic). OpenAI reports 74.9% for GPT-5 on the same benchmark (OpenAI). A 2.3 point gap on a single leaderboard would be noise. The Terminal-Bench 2 leaderboard, which scores models on multi-step terminal work rather than isolated patches, puts Sonnet 4.5 at 50.0% and GPT-5 at 43.8% (Terminal-Bench) — a wider gap on the task shape that matters most when a model is driving a shell rather than answering a question.
The practical difference shows up in agent loops. On computer-use tasks measured by OSWorld, Anthropic reports 61.4% for Sonnet 4.5, and describes the model sustaining autonomous multi-step coding for more than 30 hours in its own launch testing (Anthropic). That figure is a vendor claim, not an independent measurement, so treat it as a directional signal about long-horizon stability rather than a number to plan a sprint around. If you want a closer look at how the two ecosystems behave inside real developer tooling, our comparison of Codex and Claude Code covers the harnesses rather than the raw models.
How much cheaper is GPT-5 in practice?
Enough to change architecture decisions at volume. GPT-5 lists at $1.25 per million input tokens and $10 per million output tokens; Sonnet 4.5 lists at $3 and $15 (OpenAI pricing, Anthropic).
Run the arithmetic on a modest production workload of 10 million input tokens and 2 million output tokens per month at list prices. Sonnet 4.5 comes to $60 (Anthropic). GPT-5 comes to $32.50 (OpenAI pricing). That is about 46% less for the same traffic, and the gap scales linearly, so a team pushing ten times that volume is choosing between roughly $600 and $325 a month before any caching or batching discounts.
One caveat that catches people out: OpenAI's heavy-reasoning tier, GPT-5 Pro, is listed at $15 input and $120 output per million tokens (OpenAI pricing). If your evaluation quietly used Pro and your production plan assumes base GPT-5 pricing, your cost model is wrong by an order of magnitude on output.
Where does GPT-5 lead outside coding?
Maths and multimodal breadth. GPT-5 reaches 94.6% on AIME 2025 with no tool access and 84.2% on MMMU, the multimodal understanding benchmark (OpenAI). If your product reasons over diagrams, screenshots, scanned documents or charts, that is the more relevant axis than SWE-bench, and it points the other way.
Context length also favours GPT-5: 272K input tokens with a 400K total window, against 200K for Sonnet 4.5. For most coding work this is academic, because retrieval beats stuffing a monorepo into a prompt. It stops being academic when you are summarising long transcripts or reconciling several large documents in a single pass.
Are Sonnet 4.5 and GPT-5 still the models to compare in 2026?
Not at the frontier, and that is the honest framing. Anthropic released Claude Sonnet 5 on 30 June 2026 at $2 input and $10 output per million tokens, reporting 63.2% on SWE-bench Pro against GPT-5.5's 58.6% (Anthropic, OpenAI). Sonnet 5 versus GPT-5.5 is the current-generation question, and we cover the newer field in our 2026 coding model roundup and the Gemini 3.7 Flash comparison.
Note what the Sonnet 5 price does to this analysis: at $2 input, the newer Anthropic model undercuts Sonnet 4.5 by a third while scoring higher. If you were choosing Sonnet 4.5 today purely on capability, check whether Sonnet 5 is cheaper for you as well. The main reasons to stay on 4.5 are prompt stability, an evaluation suite you have already tuned, and pinned behaviour in a production agent you do not want to re-qualify.
How should you actually choose?
Three straightforward cases:
- Agentic coding, IDE assistants, long refactors. Sonnet 4.5. The benchmark lead is consistent across SWE-bench Verified and Terminal-Bench, and long-run stability is where it was tuned.
- High-volume API traffic, classification, extraction, summarisation, multimodal input. GPT-5. You are paying roughly half as much for capability that is close enough on non-coding work, and clearly ahead on maths and images.
- Cost floor is the hard constraint. Neither. Look at open-weight options you can host, which we compare in Qwen3-Coder versus GLM-5.2.
If the decision is about a monthly consumer subscription rather than API tokens, that is a different calculation with different winners; see ChatGPT versus Claude on which to pay for.
The limitation worth stating plainly: every headline number above except Terminal-Bench comes from the vendor that ships the model, on benchmarks the vendor chose to report. Vendor-reported SWE-bench figures also vary with scaffolding and test-time compute settings, which is why Anthropic's 77.2% carries a parallel-compute footnote. Run twenty representative tasks from your own backlog through both before committing. The benchmark gap tells you where to start; it does not tell you what your codebase will do.
FAQ
Q: Is Claude Sonnet 4.5 better than GPT-5 for coding?
A: Yes, on the published evidence. Sonnet 4.5 scores 77.2% on SWE-bench Verified against GPT-5's 74.9%, and leads 50.0% to 43.8% on Terminal-Bench 2 agentic terminal tasks.
Q: How much cheaper is GPT-5 than Claude Sonnet 4.5?
A: GPT-5 lists at $1.25 input and $10 output per million tokens versus $3 and $15 for Sonnet 4.5. On a workload of 10M input and 2M output tokens, that is $32.50 against $60 (OpenAI pricing).
Q: Which has the larger context window?
A: GPT-5, with 272K input tokens and a 400K total window, compared with 200K for Claude Sonnet 4.5.
Q: When were these models released?
A: OpenAI released GPT-5 on 7 August 2025. Anthropic released Claude Sonnet 4.5 on 29 September 2025.
Q: Should I use these or the newer models?
A: Claude Sonnet 5 (30 June 2026) and GPT-5.5 are the current generation, and Sonnet 5 is both cheaper and stronger than Sonnet 4.5 at $2 input per million tokens. Stay on the older pair only if you have pinned, qualified behaviour you do not want to disturb.
Q: Can I mix both models in one system?
A: Yes, and it is often the cheapest correct answer. Route code generation and agent steps to Sonnet 4.5, and send bulk classification, extraction and multimodal parsing to GPT-5.
Top comments (0)