Originally published at heycc.cn. This is a mirrored copy — the canonical version is kept up to date at the source.
Claude vs GPT vs Gemini API in 2026: Pricing and Features Compared
If you are about to commit a product to one LLM API, the decision is mostly cost and capability. This is a developer-focused comparison of the three major providers — Anthropic (Claude), OpenAI (GPT), and Google (Gemini) — built around what you actually pay per token and what each API can do. Every model name, price, and limit below is cited to an official pricing or model page; the links are in the Sources section so you can re-verify before you size a budget. Provider pricing is the part of this that ages fastest, so confirm any figure against its linked page before you commit.
Two numbers everyone gets wrong, up front
Pricing, model names, context windows, and output limits in this article come from the official Anthropic, OpenAI, and Google pages linked in Sources, last verified 2026-07-16. Before the comparison itself, two corrections are worth stating plainly, because earlier drafts and many third-party blogs repeat the wrong figures:
- Gemini 3.1 Pro has a 1M-token context window, not 2M. Google's own model card states "up to 1M" input tokens; the 2M figure circulating online is not what Google publishes. This article uses 1M.
- Google does not publish a flat "90% off" for cached context. Google's pricing page lists context caching as a per-token storage price ($1.00 per 1M tokens per hour), not a percentage discount on reads. Only OpenAI publishes a clean ~90%-off cached-input rate. The table below reflects exactly what each provider documents — no invented percentages.
The three lineups at a glance
Each provider ships a tiered family: a flagship for hard reasoning, a mid-tier workhorse, and a budget model for high-volume calls.
-
Anthropic (Claude): Opus 4.8 (
claude-opus-4-8) is the most capable Opus-tier model; Sonnet 5 (claude-sonnet-5) is the balanced workhorse; Haiku 4.5 is the fast, cheap tier. Above all of these sits Fable 5 (claude-fable-5), Anthropic's most capable widely released model. Per Anthropic's launch page, Fable 5 became generally available on the Claude API on June 9, 2026 at $10 input / $50 output per MTok, with a 1M context window and 128K max output. - OpenAI (GPT): GPT-5.5 is the flagship, with GPT-5.5-Pro as a higher-reasoning (and much pricier) variant. The GPT-5.4 family — 5.4, 5.4-Mini, and 5.4-Nano — covers mid and budget tiers.
- Google (Gemini): Gemini 3.1 Pro Preview leads, Gemini 3.5 Flash is the mid-tier, and Gemini 3.1 Flash-Lite is the cheapest tier-1 model. The previous-generation Gemini 2.5 Pro and 2.5 Flash remain on Google's pricing page.
Context windows compared
Context window is where the families converge more than you might expect in 2026. Claude Opus 4.8, Sonnet 5, and Fable 5 each offer 1M tokens; GPT-5.5 and GPT-5.4 each offer ~1.05M; and Gemini 3.1 Pro, 3.5 Flash, and 3.1 Flash-Lite each offer 1M. The smaller windows are Claude Haiku 4.5 at 200K and GPT-5.4-Nano at 400K.
Two things matter beyond the raw number. First, Gemini Pro's billing changes above 200K tokens — Gemini explicitly charges a higher input/output rate past that threshold (detailed in the table) — so a large window does not mean a large window at the headline price. Claude's current-generation models (Opus 4.8, Sonnet 5, Fable 5) are the exception here: Anthropic bills the full 1M-token window at one flat per-token rate with no long-context premium, per its pricing page. Second, a large window does not guarantee good recall across it; test retrieval on your own data before assuming you can skip a retrieval layer. (Large context windows are also expensive to fill on every call; for the levers that bring those costs down, see our LLM API cost control guide.)
Original comparison table: flagship, mid, and budget tiers
The table below pairs one flagship, one mid-tier, and one budget model per provider. Prices are USD per million (M) tokens. The "Cheapest path" column uses one consistent lever — cached input — quoted as the documented per-MTok rate where the provider publishes one, so the column is directly comparable. All three providers also offer a flat 50% batch discount (noted once, below the table, rather than repeated per row).
| Provider | Model | Context | Max output | Input $/MTok | Output $/MTok | Cached input $/MTok |
|---|---|---|---|---|---|---|
| Anthropic | Opus 4.8 (flagship) | 1M | 128K | $5.00 | $25.00 | ~$0.50 (cache read ~0.1x) |
| Anthropic | Sonnet 5 (mid) | 1M | 128K | $2.00† | $10.00† | ~$0.20 (cache read ~0.1x) |
| Anthropic | Haiku 4.5 (budget) | 200K | 64K | $1.00 | $5.00 | ~$0.10 (cache read ~0.1x) |
| OpenAI | GPT-5.5 (flagship) | ~1.05M | 128K | $5.00 | $30.00 | $0.50 |
| OpenAI | GPT-5.4 (mid) | ~1.05M | 128K | $2.50 | $15.00 | $0.25 |
| OpenAI | GPT-5.4-Nano (budget) | 400K | 128K | $0.20 | $1.25 | $0.02 |
| Gemini 3.1 Pro (flagship) | 1M | 64K | $2.00* | $12.00* | per-token storage (see note) | |
| Gemini 3.5 Flash (mid) | 1M | 64K | $1.50 | $9.00 | per-token storage (see note) | |
| Gemini 3.1 Flash-Lite (budget) | 1M | 64K | $0.25 | $1.50 | per-token storage (see note) |
*Gemini 3.1 Pro pricing is for prompts up to 200K tokens; above 200K it rises to $4.00 input / $18.00 output per MTok, per Google's pricing page. Anthropic also offers Fable 5 above the Opus tier at $10 input / $50 output per MTok (1M context, 128K max output).
†Claude Sonnet 5 pricing shown is introductory ($2.00 input / $10.00 output per MTok) and holds through August 31, 2026; standard pricing of $3.00 input / $15.00 output per MTok takes effect September 1, 2026, per Anthropic's pricing page.
Batch: all three providers offer a flat 50% discount for non-urgent work — Anthropic Message Batches, OpenAI Batch API, and Google batch mode.
Gemini caching: Google documents context caching as a per-token storage price ($1.00 per 1M tokens per hour) rather than a percentage discount on reads, so it is not directly comparable to OpenAI's per-MTok cached rate or Claude's ~0.1x cache-read multiplier. Model max output for all current Gemini 3.x models is 64K tokens per Google's model documentation.
To price these rows against your own traffic — input/output token counts, request volume, and the caching and batch discounts — run the numbers in our LLM API cost calculator.
API pricing deep-dive
Flagship tier. On headline input price, Gemini 3.1 Pro is the cheapest at $2.00/MTok (for prompts under 200K) versus $5.00 for both GPT-5.5 and Opus 4.8. On output the gap widens: Gemini $12, Opus $25, GPT-5.5 $30. If your workload is output-heavy (long generations, agents that write a lot), Gemini's flagship is the cheapest of the three before discounts — but remember its rate roughly doubles to $4/$18 past 200K, and the "Pro" label is still Preview. GPT-5.5-Pro sits in a different league at $30 input / $180 output, aimed at the hardest reasoning where you run few calls.
Mid tier. GPT-5.4 ($2.50/$15) and Claude Sonnet 5 (currently $2.00/$10.00 under introductory pricing, rising to $3.00/$15.00 on September 1, 2026) are close competitors; Gemini 3.5 Flash ($1.50/$9) undercuts both on headline price. This is where most production traffic should live for general tasks — the mid tier is usually the right default, and you reserve the flagship for the calls that genuinely need it.
Budget tier. For high-volume classification, extraction, and routing, the cheap models matter most. Gemini 3.1 Flash-Lite ($0.25 input / $1.50 output) and GPT-5.4-Nano ($0.20 / $1.25) are roughly a fifth the cost of Claude Haiku 4.5 ($1 / $5) on paper. Haiku's pitch is near-frontier intelligence at the fastest Claude speed, so the premium buys quality; if your budget task is genuinely simple, Nano or Flash-Lite will be far cheaper.
How discounts change the real cost. Headline prices rarely reflect what you pay in production:
- Prompt caching. Claude cache reads cost roughly 0.1x the base input price, while cache writes cost 1.25x for the 5-minute TTL and 2x for the 1-hour TTL. OpenAI documents cached input at about 90% off fresh input — e.g. GPT-5.5 at $0.50 vs $5.00, and GPT-5.4-Nano at $0.02 vs $0.20. Google supports context caching for Gemini 3, but prices it as per-token storage rather than a published read-discount percentage, so model it against your own cache hit rate rather than assuming a flat cut. For chat apps or agents that re-send a large system prompt every turn, caching is the single biggest lever on the Claude and OpenAI sides.
- Batch. All three offer a flat 50% reduction for non-urgent work. Anthropic's Message Batches API runs at 50% of standard prices, supports up to 100,000 requests or 256 MB per batch, and most batches finish within an hour (24-hour maximum). OpenAI's Batch API and Google's batch mode offer the same 50% reduction. If your job is asynchronous — overnight enrichment, bulk summarization — batch halves the bill for free.
Core API features matrix
All three support the core building blocks; the differences are in breadth of hosted tools and native multimodality.
| Feature | Claude (Opus 4.8) | GPT-5.5 | Gemini 3.1 Pro |
|---|---|---|---|
| Function / tool calling | Yes | Yes | Yes |
| Structured outputs / JSON | Yes | Yes | Yes |
| Prompt caching | Yes (read ~0.1x) | Yes (cached input ~90% off) | Yes (per-token storage) |
| Batch API (50% off) | Yes | Yes | Yes |
| Vision / image input | Yes | Yes | Yes |
| Native audio + video input | Image only | Image only | Yes (text/image/audio/video) |
| Hosted tool surface | Code execution, web search/fetch, MCP, computer use, memory | Web search, file search, image gen, code interpreter, MCP | Broad multimodal + tools |
Gemini's distinguishing edge is native multimodality across text, image, audio, and video — Claude and GPT-5.5 take image input but not native audio/video. Claude's strength is its tool-use ergonomics and predictable caching economics for agent loops; OpenAI ships a broad set of hosted tools out of the box. For the exact, current feature list per provider, check each provider's docs (linked in Sources) — hosted-tool surfaces change faster than pricing.
Matching a provider to your workload
Let the workload's binding constraint decide, rather than a leaderboard position:
- Cheapest output-heavy generation → Gemini 3.1 Pro (lowest flagship output price at $12/MTok under 200K), or Gemini 3.5 Flash if you don't need flagship reasoning.
- Hardest reasoning, few calls → GPT-5.5-Pro ($30/$180) or Claude Fable 5 ($10/$50); accept the premium because you run few calls and correctness dominates cost.
- Default production traffic → a mid-tier model (GPT-5.4, Sonnet 5, or Gemini 3.5 Flash). Reserve the flagship for the subset of calls that genuinely need it; this is the single biggest cost lever for most apps.
- High-volume classification / extraction / routing → a budget model (GPT-5.4-Nano or Gemini 3.1 Flash-Lite for raw cost; Haiku 4.5 when you want near-frontier quality at the cheapest Claude speed).
- Native audio or video input → Gemini, the only one of the three with native multimodality across all four modalities.
- Agent loops with a large, stable system prompt → Claude or GPT-5.5, where published caching discounts (~0.1x read for Claude, ~90% off cached input for OpenAI) make repeated-prefix workloads dramatically cheaper than the headline rate suggests.
For most teams it comes down to four habits: run the mid tier by default, cache aggressively, batch anything asynchronous, and escalate to a flagship only for the calls that fail at mid tier. Which provider you pick matters less than getting those four right. And if you are choosing an AI coding tool built on top of these APIs rather than calling them directly, our best AI coding assistants comparison covers that layer.
Sources
- Anthropic — Introducing Claude Fable 5 and Claude Mythos 5 (GA date, pricing, context, max output)
- Anthropic — Models overview (Opus 4.8, Sonnet 5, Haiku 4.5 pricing, context windows, max output)
- Anthropic — Pricing (per-MTok rates, Batch API, prompt caching)
- Anthropic — Prompt caching (cache read ~0.1x; write 1.25x for 5m, 2x for 1h)
- Anthropic — Batch processing (50% discount; 100,000 requests / 256 MB; 24h max)
- OpenAI — API pricing (GPT-5.5, GPT-5.5-Pro, GPT-5.4, GPT-5.4-Mini, GPT-5.4-Nano; cached input; batch)
- OpenAI — GPT-5.5 model (1.05M context, 128K max output)
- OpenAI — GPT-5.4 model (1.05M context, 128K max output)
- OpenAI — GPT-5.4-nano model (400K context, 128K max output)
- Google — Gemini API pricing (3.1 Pro tiered pricing, 3.5 Flash, 3.1 Flash-Lite, 2.5 Pro/Flash, batch, caching)
- Google DeepMind — Gemini 3.1 Pro model card (1M context, 64K output)
- Google — Gemini 3 developer guide (context windows, max output, context caching)

Top comments (0)