GPT-5.1-Codex vs Claude Sonnet 4

Compare GPT-5.1-Codex by OpenAI against Claude Sonnet 4 by Anthropic, context windows of 400K vs 200K, tested across 33 shared challenges. Updated April 2026.

Which is better, GPT-5.1-Codex or Claude Sonnet 4?

GPT-5.1-Codex and Claude Sonnet 4 are both competitive models. GPT-5.1-Codex costs $1.25/M input tokens vs $3/M for Claude Sonnet 4. Context windows: 400K vs 200K tokens. Compare their real outputs side by side below.

Key Differences Between GPT-5.1-Codex and Claude Sonnet 4

GPT-5.1-Codex is made by openai while Claude Sonnet 4 is from anthropic. GPT-5.1-Codex has a 400K token context window compared to Claude Sonnet 4's 200K. On pricing, GPT-5.1-Codex costs $1.25/M input tokens vs $3/M for Claude Sonnet 4.

Our Verdict
GPT-5.1-Codex
GPT-5.1-Codex
Claude Sonnet 4
Claude Sonnet 4Runner-up

No community votes yet. On paper, GPT-5.1-Codex has the edge — bigger model tier, newer, bigger context window.

Slight edge
Writing DNA

Style Comparison

Similarity
94%

Claude Sonnet 4 uses 87.9x more emoji

GPT-5.1-Codex
Claude Sonnet 4
70%Vocabulary62%
17wSentence Length111w
0.39Hedging0.40
3.4Bold5.0
3.5Lists9.3
0.00Emoji0.88
0.50Headings2.16
0.38Transitions0.33
Based on 14 + 17 text responses
vs

Ask them anything yourself

GPT-5.1-CodexClaude Sonnet 4

279 AI models invented the same fake scientist.

We read every word. 250 models. 2.14 million words. This is what we found.

AI Hallucination Index 2026
Free preview13 of 58 slides
FAQ

Common questions