Price Per TokenPrice Per Token
OpenAI
OpenAI
vs
Perplexity
Perplexity

GPT-5 Codex vs Sonar

A detailed comparison of pricing, benchmarks, and capabilities

OpenClaw

Best LLMs for OpenClaw Vote for which model works best with OpenClaw

112 out of our 301 tracked models have had a price change in February.

Get our weekly newsletter on pricing changes, new releases, and tools.

Key Takeaways

GPT-5 Codex wins:

  • Larger context window
  • Faster response time
  • Higher intelligence benchmark
  • Better at coding
  • Better at math
  • Supports tool calls

Sonar wins:

  • Cheaper input tokens
  • Cheaper output tokens
Price Advantage
Sonar
Benchmark Advantage
GPT-5 Codex
Context Window
GPT-5 Codex
Speed
GPT-5 Codex

Pricing Comparison

Price Comparison

MetricGPT-5 CodexSonarWinner
Input (per 1M tokens)$1.25$1.00 Sonar
Output (per 1M tokens)$10.00$1.00 Sonar
Cache Read (per 1M)$125000.00N/A GPT-5 Codex
Using a 3:1 input/output ratio, Sonar is 71% cheaper overall.

GPT-5 Codex Providers

OpenAI $1.25 (Cheapest)

Sonar Providers

Perplexity $1.00 (Cheapest)
Vercel $1.00 (Cheapest)

Benchmark Comparison

7
Benchmarks Compared
4
GPT-5 Codex Wins
0
Sonar Wins

Benchmark Scores

BenchmarkGPT-5 CodexSonarWinner
Intelligence Index
Overall intelligence score
44.515.5
Coding Index
Code generation & understanding
38.9--
Math Index
Mathematical reasoning
98.7--
MMLU Pro
Academic knowledge
86.568.9
GPQA
Graduate-level science
83.747.1
LiveCodeBench
Competitive programming
84.029.5
AIME
Competition math
-48.7-
GPT-5 Codex significantly outperforms in coding benchmarks.

Cost vs Quality

X-axis:
Y-axis:
Loading chart...
GPT-5 Codex
Other models

Context & Performance

Context Window

GPT-5 Codex
400,000
tokens
Max output: 128,000 tokens
Sonar
127,072
tokens
GPT-5 Codex has a 68% larger context window.

Speed Performance

MetricGPT-5 CodexSonarWinner
Tokens/second314.7 tok/s131.1 tok/s
Time to First Token10.95s1.38s
GPT-5 Codex responds 140% faster on average.

Capabilities

Feature Comparison

FeatureGPT-5 CodexSonar
Vision (Image Input)
Tool/Function Calls
Reasoning Mode
Audio Input
Audio Output
PDF Input
Prompt Caching
Web Search

License & Release

PropertyGPT-5 CodexSonar
LicenseProprietaryProprietary
AuthorOpenAIPerplexity
ReleasedSep 2025Jan 2025

GPT-5 Codex Modalities

Input
textimage
Output
text

Sonar Modalities

Input
textimage
Output
text

Related Comparisons

Compare GPT-5 Codex with:

Compare Sonar with:

Frequently Asked Questions

Sonar has cheaper input pricing at $1.00/M tokens. Sonar has cheaper output pricing at $1.00/M tokens.
GPT-5 Codex scores higher on coding benchmarks with a score of 38.9, compared to Sonar's score of N/A.
GPT-5 Codex has a 400,000 token context window, while Sonar has a 127,072 token context window.
GPT-5 Codex supports vision. Sonar supports vision.