AI Model Intelligence

Comparison · 2026-06-29

GPT-5.1 Codex vs Claude Sonnet 4.5 (latest)

Side-by-side comparison of pricing, context window and capabilities for GPT-5.1 Codex (OpenAI) and Claude Sonnet 4.5 (latest) (Anthropic). Focus: coding.

GPT-5.1 CodexClaude Sonnet 4.5 (latest)
VendorOpenAIAnthropic
Input price / 1M tokens$1.25$3.00
Output price / 1M tokens$10.00$15.00
Total per 1M (in + out)$11.25$18.00
Context window400K200K
Max output tokens128K64K
Tool callingYesYes
Structured outputYesUnknown
ReasoningYesYes
Vision inputYesYes
Open weightsNoNo
Provider availability19 providers21 providers
Release date2025-11-132025-09-29
Knowledge cutoff2024-09-302025-07-31

Quick takeaway

  • GPT-5.1 Codex is 1.6× cheaper per 1M tokens (input + output combined).
  • GPT-5.1 Codex has a larger context window (400K vs 200K).
  • Only GPT-5.1 Codex supports structured output / JSON mode.
  • Claude Sonnet 4.5 (latest) is more widely available across providers (21 vs 19).
GPT-5.1 Codex · See all 19 providers →Claude Sonnet 4.5 (latest) · See all 21 providers →

How to read this comparison

This page compares GPT-5.1 Codex and Claude Sonnet 4.5 (latest) on the dimensions that matter most for production LLM selection: per-token cost, context window, declared capabilities (tool calling, structured output, reasoning, vision), and provider availability.

Green highlights in the table indicate which model leads on a given row. "Leads" means lower price or higher context/capability — not necessarily "better for your use case". A model that costs 3× more may still be the right choice if it unlocks a capability you need.

What this comparison does NOT tell you

  • Quality / accuracy — we have no benchmark data. Declared capabilities ≠ measured performance.
  • Latency — time-to-first-token varies by provider, region and load. Test with your actual traffic.
  • Prompt caching savings — if you reuse system prompts, the cheaper model on headline rate may not be cheapest in practice.
  • Fine-tuning availability — not all models can be fine-tuned, even if they are open-weight.

Data is refreshed daily. If a model's capabilities or pricing change, this page updates automatically on the next build cycle.

Frequently asked questions

Is GPT-5.1 Codex cheaper than Claude Sonnet 4.5 (latest)?

GPT-5.1 Codex costs $1.25/1M tokens input + $10.00/1M tokens output, while Claude Sonnet 4.5 (latest) costs $3.00/1M tokens input + $15.00/1M tokens output. GPT-5.1 Codex is cheaper per combined 1M tokens.

Which model has a longer context window, GPT-5.1 Codex or Claude Sonnet 4.5 (latest)?

GPT-5.1 Codex supports a longer context window — 400,000 tokens vs 200,000 tokens.

Where can I run GPT-5.1 Codex and Claude Sonnet 4.5 (latest)?

GPT-5.1 Codex is available on 19 providers; Claude Sonnet 4.5 (latest) is available on 21 providers. See each model's detail page for the full provider list.

Last updated:

Prices in USD per 1M tokens. Unknown means the provider does not publish per-token pricing.

Pricing and capabilities are refreshed daily and reconciled against each provider's official documentation. Always verify critical production decisions with the provider directly.