Claude 5 Sonnet vs GPT-4o: pricing & cost comparison
On input tokens, Claude 5 Sonnet is the cheaper of the two — 20% less per million ($2 vs $2.5). Both charge $10 per million output tokens.
Side by side
| Claude 5 Sonnet | GPT-4o | |
|---|---|---|
| Input / 1M tokens | $2 | $2.5 |
| Output / 1M tokens | $10 | $10 |
| Context window | 1,000,000 | 128,000 |
| Token-count accuracy | ±2% | exact |
| Cost — 10,000 input + 2,000 output tokens | $0.04 | $0.045 |
What a real request costs
Take a representative turn — 10,000 input + 2,000 output tokens. Claude 5 Sonnet comes to $0.04, GPT-4o to $0.045. Across 100,000 requests that's a $500 swing in favour of Claude 5 Sonnet. To run the numbers on your actual prompt, paste it into the calculator and toggle Compare across all models.
Close call — decide on output cost
Claude 5 Sonnet and GPT-4o are close enough on price that the tie-breakers matter more than the headline rate. Output tokens are usually the dominant cost driver, so weigh $10 vs $10 per 1M output first, then context window — Claude 5 Sonnet carries the larger one at 1,000,000 tokens. They're different vendors, so factor in a small tokenizer calibration buffer on whichever side isn't exact.
See the full breakdown on the dedicated pages for Claude 5 Sonnet and GPT-4o.
FAQ
- Is Claude 5 Sonnet or GPT-4o cheaper?
- For a typical request (10,000 input + 2,000 output tokens), Claude 5 Sonnet is cheaper — about 11% less, or roughly $500 saved per 100,000 requests. Claude 5 Sonnet runs $2/$10 per 1M input/output tokens; GPT-4o runs $2.5/$10.
- Which has the larger context window?
- Claude 5 Sonnet, at 1,000,000 tokens versus 128,000.
- How accurate are these token counts?
- Claude 5 Sonnet: Approximated with cl100k_base — drift typically <2% on English and code. GPT-4o: Exact tokenization via the canonical OpenAI vocab (o200k_base). The dollar math itself is exact once the token count is known.
Both prices are computed from tokenmath's verified pricing table. Rates sourced from platform.claude.com and openai.com, verified 2026-07-06. Vendor pricing changes often — confirm before you commit.