grok-4 vs claude-sonnet-4-5
Side-by-side comparison of grok-4 and claude-sonnet-4-5 — benchmarks, pricing, context window and capabilities. Both are accessible through Requesty's unified API. grok-4 outperforms claude-sonnet-4-5 on 8 of 8 shared benchmarks.
xAI Corp.
grok-4
Input / 1M
$3.00
Output / 1M
$15.00
Context
256K
Model ID
xai/grok-4
claude-sonnet-4-5
Input / 1M
$3.00
Output / 1M
$15.00
Context
1M
Model ID
anthropic/claude-sonnet-4-5
Benchmark comparison
MMLU Proknowledge
grok-487.5%
claude-sonnet-4-583.8%
GPQA Diamondreasoning
grok-487.5%
claude-sonnet-4-574.2%
HumanEvalcoding
grok-493.8%
claude-sonnet-4-592.0%
SWE-Bench Verifiedcoding
grok-472.5%
claude-sonnet-4-570.8%
MATHmath
grok-494.1%
claude-sonnet-4-587.5%
AIME 2024math
grok-490.1%
claude-sonnet-4-576.1%
MMMUmultimodal
grok-477.9%
claude-sonnet-4-573.1%
LiveBenchreasoning
grok-475.4%
claude-sonnet-4-569.5%
τ-bench Retailagentic
grok-4—
claude-sonnet-4-567.3%
Scores sourced from official model cards, Artificial Analysis, and public leaderboards. Benchmarks measure specific skills and don't capture every aspect of model quality.
Pricing & specifications
| grok-4 | claude-sonnet-4-5 | |
|---|---|---|
| Input price / 1M | $3.00 | $3.00 |
| Output price / 1M | $15.00 | $15.00 |
| Context window | 256K tokens | 1M tokens |
| Max output | — | 64K tokens |
| Vision input | Yes | Yes |
| Tool calling | Yes | Yes |
| Reasoning | — | Yes |
| Prompt caching | Yes | Yes |
| Computer use | Yes | Yes |
| Provider | xAI Corp. | Anthropic PBC |
Questions people ask
Is grok-4 better than claude-sonnet-4-5?
grok-4 outperforms claude-sonnet-4-5 on 8 of 8 shared benchmarks. See the benchmark comparison above for specifics — grok-4 and claude-sonnet-4-5 have different strengths across reasoning, coding, math and multimodal tasks.
Which is cheaper — grok-4 or claude-sonnet-4-5?
grok-4 and claude-sonnet-4-5 have identical combined pricing.
Can I use grok-4 and claude-sonnet-4-5 through the same API?
Yes. Requesty provides a single OpenAI-compatible API that routes to both. Change just the "model" parameter to switch — "xai/grok-4" or "anthropic/claude-sonnet-4-5" — no other code changes needed.
What are the context windows?
grok-4 supports up to 256K tokens of context. claude-sonnet-4-5 supports up to 1M tokens. Longer context means you can feed larger documents or codebases in a single prompt, though quality often degrades past 128K for most models.
Switch between grok-4 and claude-sonnet-4-5 with one line of code
Requesty provides a single OpenAI-compatible API for 400+ models. Change the model parameter, not your code.
Get started free