GPT-5.2-Codex vs Sonar
GPT-5.2-Codex leads Sonar on the Artificial Analysis Intelligence Index, 28.5 to 7.7, and Sonar costs 14.0x less per output token ($1.00 vs $14.00 per million). Updated October 21, 2026; 3 benchmarks have a result for both.
GPT-5.2-Codex or Sonar: which to pick
Only GPT-5.2-Codex has a coding score, 45.4 on the Vibe Coding Index; Sonar has none, so the two cannot be ranked on coding.
Pick Sonar for output tokens 14.0x cheaper ($1.00 vs $14.00 per million).
- Shared results
- 3
- GPT-5.2-Codex only
- 19
- Sonar only
- 2
- Like-for-like categories
- 2 of 9
Only benchmarks that tested both models count toward a pick; a result only one model has is shown but not compared.
Which one for your work
Each card is decided by one number both models carry. Where only one has it, the card says so and makes no call.
Coding
Vibe Coding Index, six public coding benchmarks
No call
Only GPT-5.2-Codex has a coding score, so no call is made.
One side not measured
Intelligence
AA Intelligence Index
GPT-5.2-Codex
GPT-5.2-Codex leads, 28.5 against 7.7.
Same board, both measured
Long documents
Listed context window
GPT-5.2-Codex
GPT-5.2-Codex takes 400K tokens against 127K.
Listed by OpenRouter
Everyday cost
1K input + 500 output tokens
Sonar
GPT-5.2-Codex $0.0088, Sonar $0.0015 per turn.
List prices
Cost per solved task
One SWE-bench Verified task, solved
No call
Only GPT-5.2-Codex has the number, $0.43.
Directional only
At a glance
- Coding index
- GPT-5.2-Codex 45.4 from 3 benchmarks, Sonar not benchmarked.
- Widest category
- Reasoning, 36.8 points apart on average over 2 shared benchmarks.
- Widest single gap
- GPQA Diamond (Artificial Analysis run): GPT-5.2-Codex 89.9% against Sonar 47.1%, 42.8 points apart on a 0 to 100 scale.
- Output price
- GPT-5.2-Codex $14.00 against Sonar $1.00 per million output tokens, 14.0x apart.
- Context window
- GPT-5.2-Codex takes 400K tokens, Sonar 127K.
Benchmark by benchmark
First the score: boards each model leads, per category, where both have a result. Then every board, a category to a fold; bars are each result on a 0 to 100 scale, so compare the two in a row, not one row with another.
| Category | GPT-5.2-Codex | Bars | Sonar | Ties |
|---|---|---|---|---|
| Intelligence | 1 | 0 | ||
| Reasoning | 2 | 0 | ||
| All shared boards | 3 | 0 |
CodingDirectional onlySix of these boards feed the Vibe Coding Index12 boards, none shared
| Benchmark | GPT-5.2-Codex | Sonar | Leader |
|---|---|---|---|
| SWE-bench Verified | 72.8% | Not measured | Only GPT-5.2-Codex measured |
| SWE-bench Multilingual | 66.3% | Not measured | Only GPT-5.2-Codex measured |
| LMArena WebDev | 1339 | Not measured | Only GPT-5.2-Codex measured |
| LiveCodeBench (Vals AI) | 88.0% | Not measured | Only GPT-5.2-Codex measured |
| SWE-bench Verified (Vals AI) | 72.4% | Not measured | Only GPT-5.2-Codex measured |
| Vibe Code Bench (Vals AI) | 37.9% | Not measured | Only GPT-5.2-Codex measured |
| LiveCodeBench (Artificial Analysis run) | Not measured | 29.5% | Only Sonar measured |
| Terminal-Bench Hard (Artificial Analysis run) | 37.1% | Not measured | Only GPT-5.2-Codex measured |
| Terminal-Bench | 66.5% | Not measured | Only GPT-5.2-Codex measured |
| ALE-Bench | 1299.9 | Not measured | Only GPT-5.2-Codex measured |
| LMArena WebDev: React | 1329 | Not measured | Only GPT-5.2-Codex measured |
| LMArena WebDev: HTML | 1348 | Not measured | Only GPT-5.2-Codex measured |
| Neither model has a result on the other 27 boards here | |||
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index10
| Benchmark | GPT-5.2-Codex | Sonar | Leader |
|---|---|---|---|
| AA Intelligence Index | 28.5 | 7.7 | GPT-5.2-Codex |
| Neither model has a result on the other 1 board here | |||
Agentic workDirectional onlyPublic boards, shown as published, kept out of the index6 boards, none shared
| Benchmark | GPT-5.2-Codex | Sonar | Leader |
|---|---|---|---|
| Design Arena: agents building web apps | 1051 | Not measured | Only GPT-5.2-Codex measured |
| Design Arena: agents building full-stack apps | 993 | Not measured | Only GPT-5.2-Codex measured |
| Design Arena: agents building mobile apps | 1090 | Not measured | Only GPT-5.2-Codex measured |
| Design Arena: agents building Android apps | 1176 | Not measured | Only GPT-5.2-Codex measured |
| Design Arena: agents building Godot games | 1142 | Not measured | Only GPT-5.2-Codex measured |
| τ²-Bench Telecom | 92.1% | Not measured | Only GPT-5.2-Codex measured |
| Neither model has a result on the other 35 boards here | |||
ReasoningLike-for-likePublic boards, shown as published, kept out of the index20
| Benchmark | GPT-5.2-Codex | Sonar | Leader |
|---|---|---|---|
| GPQA Diamond (Artificial Analysis run) | 89.9% | 47.1% | GPT-5.2-Codex |
| Humanity's Last Exam (Artificial Analysis run) | 35.7% | 4.9% | GPT-5.2-Codex |
| Neither model has a result on the other 20 boards here | |||
MathNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
| Benchmark | GPT-5.2-Codex | Sonar | Leader |
|---|---|---|---|
| Neither model has a result on 13 boards here | |||
KnowledgeDirectional onlyPublic boards, shown as published, kept out of the index1 board, none shared
| Benchmark | GPT-5.2-Codex | Sonar | Leader |
|---|---|---|---|
| MMLU Pro (Artificial Analysis run) | Not measured | 68.9% | Only Sonar measured |
| Neither model has a result on the other 17 boards here | |||
Web designNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
| Benchmark | GPT-5.2-Codex | Sonar | Leader |
|---|---|---|---|
| Neither model has a result on 9 boards here | |||
GeneralDirectional onlyPublic boards, shown as published, kept out of the index2 boards, none shared
| Benchmark | GPT-5.2-Codex | Sonar | Leader |
|---|---|---|---|
| IFBench | 77.6% | Not measured | Only GPT-5.2-Codex measured |
| Long context reasoning (AA-LCR) | 82.3% | Not measured | Only GPT-5.2-Codex measured |
| Neither model has a result on the other 44 boards here | |||
Image generationNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
| Benchmark | GPT-5.2-Codex | Sonar | Leader |
|---|---|---|---|
| Neither model has a result on 5 boards here | |||
What each workload costs
Three fixed token mixes at each model's listed price, so per-token rates become a bill.
Chat turn
1K input + 500 output tokens
Sonar costs less
Repository review
50K input + 3K output tokens
Sonar costs less
Agent loop
200K input + 10K output tokens
Sonar costs less
Listed OpenRouter rates, without cache or batch discounts. A workload that does not fit a model's context window would need splitting.
Specification differences
The leading value in a row is marked; a row with a missing value names no leader. Our two rows are marked in red.
| Specification | OpenAI GPT-5.2-Codex | Perplexity Sonar |
|---|---|---|
| Maker | OpenAI | Perplexity |
| Weights | No public weights listed | No public weights listed |
| Released | January 14, 2026 | January 27, 2025 |
| Context window | 400K | 127K |
| Input $/Mtok | $1.75 | $1.00 |
| Output $/Mtok | $14.00 | $1.00 |
| Coding index | 45.4 | Not benchmarked |
| Independent measurements behind it | 3 | 0 |
| Cost per solved task | $0.43 | Not computable |
| Source | OpenRouter listing | OpenRouter listing |
Questions
Is GPT-5.2-Codex better than Sonar for coding?
Only GPT-5.2-Codex has a coding score, 45.4 on the Vibe Coding Index; Sonar has none, so the two cannot be ranked on coding. Pick Sonar for output tokens 14.0x cheaper ($1.00 vs $14.00 per million).
Which is cheaper, GPT-5.2-Codex or Sonar?
GPT-5.2-Codex costs $1.75 per million input tokens and $14.00 per million output tokens; Sonar costs $1.00 and $1.00. Cost per solved task is known for GPT-5.2-Codex only.
Which has the bigger context window, GPT-5.2-Codex or Sonar?
GPT-5.2-Codex, with 400K tokens against 127K.
How many benchmarks is the GPT-5.2-Codex vs Sonar comparison based on?
3 benchmarks have a result for both models as of October 21, 2026. GPT-5.2-Codex's coding index rests on 3 independent benchmarks and Sonar's on 0. Where only one model has a result, the page says so instead of naming a winner.