Compare Claude Sonnet 4 from Anthropic and GPT-5 from OpenAI on key metrics including benchmarks, price, context length, and other model features. Access both models and hundreds of others through the OpenRouter API.
Claude Sonnet 4 and GPT-5 are available through the OpenRouter API, so switching between them takes a model slug change rather than a new integration.
Claude Sonnet 4, from Anthropic, has a 200,000-token context window and is priced at $3/M tokens input, $15/M tokens output on OpenRouter.
GPT-5, from OpenAI, has a 400,000-token context window and is priced at $1.25/M tokens input, $10/M tokens output on OpenRouter.
| Claude Sonnet 4 | GPT-5 | |
|---|---|---|
| Input price | $3/M tokens | $1.25/M tokens |
| Output price | $15/M tokens | $10/M tokens |
| Context window | 200,000 tokens | 400,000 tokens |
| Intelligence Index | Not available | Not available |
| Coding Index | 37.6 | 37.8 |
| Agentic Index | Not available | Not available |
| Latency (p50) | 2.11 s | 4.82 s |
| Throughput (p50) | Not available | 73.0 tok/s |
GPT-5 has the longer context window at 400,000 tokens, compared with 200,000 tokens for Claude Sonnet 4.
GPT-5 scores higher on coding, with an Artificial Analysis Coding Index of 37.8 compared with 37.6 for Claude Sonnet 4.