Price Per TokenPrice Per Token
OpenAI
OpenAI
vs
Perplexity
Perplexity

GPT-5.1-Codex vs Sonar

A detailed comparison of pricing, benchmarks, and capabilities

114 out of our 483 tracked models have had a price change in March.

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

Key Takeaways

GPT-5.1-Codex wins:

  • Larger context window
  • Higher intelligence benchmark
  • Better at coding
  • Better at math
  • Has reasoning mode

Sonar wins:

  • Cheaper input tokens
  • Cheaper output tokens
  • Faster response time
Price Advantage
Sonar
Benchmark Advantage
GPT-5.1-Codex
Context Window
GPT-5.1-Codex
Speed
Sonar

Pricing Comparison

Price Comparison

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

GPT-5.1-Codex Providers

No provider data available

Sonar Providers

No provider data available

Benchmark Comparison

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

Benchmark Scores

BenchmarkGPT-5.1-CodexSonarWinner
Intelligence Index
Overall intelligence score
43.115.5
Coding Index
Code generation & understanding
36.6--
Math Index
Mathematical reasoning
95.7--
MMLU Pro
Academic knowledge
86.068.9
GPQA
Graduate-level science
86.047.1
LiveCodeBench
Competitive programming
84.929.5
AIME
Competition math
-48.7-
GPT-5.1-Codex significantly outperforms in coding benchmarks.

Cost vs Quality

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

Context & Performance

Context Window

GPT-5.1-Codex
400,000
tokens
Sonar
127,072
tokens
GPT-5.1-Codex has a 68% larger context window.

Speed Performance

MetricGPT-5.1-CodexSonarWinner
Tokens/second93.0 tok/s121.8 tok/s
Time to First Token7.53s1.36s
Sonar responds 31% faster on average.

Capabilities

Feature Comparison

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

License & Release

PropertyGPT-5.1-CodexSonar
LicenseProprietaryProprietary
AuthorOpenAIPerplexity
ReleasedNov 2025Jan 2025

GPT-5.1-Codex Modalities

Input
textimage
Output
text

Sonar Modalities

Input
textimage
Output
text

Related Comparisons

Compare GPT-5.1-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.1-Codex scores higher on coding benchmarks with a score of 36.6, compared to Sonar's score of N/A.
GPT-5.1-Codex has a 400,000 token context window, while Sonar has a 127,072 token context window.
GPT-5.1-Codex supports vision. Sonar supports vision.