LLM API Pricing Comparison: Cost Per Token 2026 (GPT-4o vs Claude vs Gemini)

By Navneet Arya · 🕒 12 min read

Quick Answer

As of July 2026, Claude Sonnet 5 is the cheapest frontier-tier model at $2/$10 per million input/output tokens (introductory, through August 31), Gemini 3.5 Flash costs $1.50/$9, and GPT-5.4 costs $2.50/$15. GPT-4o no longer appears on OpenAI's official pricing page — GPT-5.4 and GPT-5.5 are its direct successors for any 2026 API pricing comparison.

Real, verified July 2026 LLM API pricing per token — GPT-5.5/GPT-4o, Claude Sonnet 5/Opus 4.8, and Gemini 3.5/3.1 Pro compared, plus a worked cost example.
Quick Answer

For LLM API pricing as of July 2026: Claude Sonnet 5 is the cheapest frontier-tier model at $2/$10 per million input/output tokens (introductory, through August 31), Gemini 3.5 Flash costs $1.50/$9, and GPT-5.4 costs $2.50/$15. GPT-4o no longer appears on OpenAI's official pricing page — GPT-5.4 and GPT-5.5 are its direct successors for any 2026 API pricing comparison.

The "GPT-4o vs Claude vs Gemini" search habit has not caught up with reality — GPT-4o has been retired from ChatGPT entirely and dropped off OpenAI's own pricing table, so the real 2026 comparison is GPT-5.4/5.5 vs Claude Sonnet 5 vs Gemini 3.5 Flash. Sonnet 5's introductory $2/$10 rate through August 31 makes it the one worth routing to right now if quality-per-dollar is the goal, though its heavier tokenizer eats into that headline discount on real workloads.
— Navneet Arya, AI Nexus

Why "GPT-4o vs Claude vs Gemini" Is the Wrong Question in July 2026

GPT-4o is still the model most people type into a search bar when they want to compare LLM API pricing, and for most of 2024 and 2025 that made sense — it was OpenAI's default workhorse model. That is no longer true.

OpenAI retired GPT-4o from ChatGPT in two stages: consumer access was cut on February 13, 2026, and the remaining access through Custom GPTs for Business, Enterprise, and Edu plans ended on April 3, 2026.

Checking OpenAI's own developer pricing page today, GPT-4o does not appear anywhere in the current flagship or all-models pricing tables alongside GPT-5.5 and GPT-5.4 — it has effectively moved off the price list that OpenAI actively maintains for new integrations.

That leaves a gap between what people search for and what providers actually publish.

That matters for anyone budgeting an LLM API project in 2026, because a lot of "GPT-4o vs Claude vs Gemini" comparisons still circulating online quote GPT-4o's old $2.50/$10.00 per million token rate as if it were OpenAI's current flagship price. It is not. This guide uses the numbers OpenAI, Anthropic, and Google actually publish today, verified directly against each provider's official pricing documentation on July 6, 2026, and treats GPT-5.4 and GPT-5.5 as GPT-4o's real successors for cost comparison purposes.

LLM API Pricing Comparison — Verified July 2026

Every model below is billed per million tokens, split between input (what you send) and output (what the model generates). Rates shown are standard, non-batch, non-cached pricing at global endpoints — the starting point before any of the cost-cutting levers covered further down.

Model Provider Input $/M Output $/M Context
GPT-5.5 OpenAI $5.00 $30.00 Long-context surcharge above ~270K
GPT-5.4 OpenAI $2.50 $15.00 Long-context surcharge above ~270K
GPT-5.4 mini OpenAI $0.75 $4.50 Standard
Claude Opus 4.8 Anthropic $5.00 $25.00 1M tokens, flat rate
Claude Sonnet 5 Anthropic $2.00 (until Aug 31) → $3.00 $10.00 (until Aug 31) → $15.00 1M tokens, flat rate
Claude Haiku 4.5 Anthropic $1.00 $5.00 200K tokens
Gemini 3.1 Pro Preview Google $2.00 (≤200K) / $4.00 (>200K) $12.00 (≤200K) / $18.00 (>200K) Up to 2M (reported)
Gemini 3.5 Flash Google $1.50 $9.00 ~1M tokens
Gemini 2.5 Flash-Lite Google $0.10 $0.40 Standard, free tier available

OpenAI: GPT-5.5 and GPT-5.4 Replace GPT-4o

OpenAI's current flagship lineup is GPT-5.5 at $5.00 input / $30.00 output per million tokens, with a $0.50 cached-input rate, and GPT-5.4 as the mid-tier option at $2.50/$15.00. Both step up to roughly double those rates once a request's input crosses a long-context threshold — reported at around 270,000 tokens for the GPT-5.5/5.4 family.

For budget routing, GPT-5.4 mini ($0.75/$4.50) and GPT-5.4 nano ($0.20/$1.25) exist below the flagship tier. GPT-4o is not listed in OpenAI's current pricing documentation at all — a genuine change from earlier in 2026, when it still appeared as a legacy option.

Anthropic: Claude Sonnet 5's Introductory Window

Anthropic's current lineup is Claude Opus 4.8 at $5.00/$25.00, Claude Sonnet 5 at an introductory $2.00/$10.00 through August 31, 2026 (reverting to $3.00/$15.00 after that date, the same rate as the outgoing Sonnet 4.6), and Claude Haiku 4.5 at $1.00/$5.00. One detail that headline pricing tables tend to miss: Sonnet 5, along with Opus 4.7 and later Opus models, uses a newer tokenizer that produces roughly 30% more tokens for the same input text compared to the previous generation.

That means the effective cost of a real task on Sonnet 5 can land higher than the raw per-token rate implies, even during the discounted introductory period. Anthropic is also the only one of the three providers to include a full 1 million token context window at flat, standard pricing across its current models — no long-context surcharge, unlike OpenAI and Google.

Google: Gemini 3.5 Flash Undercuts the Pro Tier

Google's Gemini API splits into a Pro tier and a Flash tier with meaningfully different economics. Gemini 3.1 Pro Preview costs $2.00/$12.00 per million tokens up to a 200,000-token prompt, stepping to $4.00/$18.00 above that threshold, and has been paid-only since April 1, 2026 — Google removed free-tier access to its Pro-class models that month.

Gemini 3.5 Flash, launched at Google I/O 2026, costs $1.50/$9.00 with no context-length pricing tiers and — notably — still offers a genuine free tier with reduced rate limits, something neither OpenAI's nor Anthropic's current-generation flagship models do. For the cheapest possible routing tier, Gemini 2.5 Flash-Lite at $0.10/$0.40 remains available with a free tier as well.

How These Prices Have Moved Since Early 2026

LLM API pricing has not been static this year, and the direction of movement differs by provider. OpenAI's flagship rate actually rose in 2026: GPT-5.5 at $5.00/$30.00 costs twice as much per input token as GPT-4o's old $2.50 rate, reflecting OpenAI's strategy of pricing its most capable model as a genuine premium tier rather than a like-for-like replacement — GPT-5.4 at $2.50/$15.00 is the closer price match to what GPT-4o used to cost.

Anthropic moved in the opposite direction at the flagship level: Opus dropped from $15.00/$75.00 (Opus 4.1) to $5.00/$25.00 across Opus 4.5 through 4.8, a 3x cut carried forward across four consecutive releases. Google's most consequential 2026 change was not a price cut but a free-tier restriction — Gemini Pro-class models lost free access entirely on April 1, 2026, pushing anyone prototyping with Gemini 3.1 Pro onto a paid account, while Flash and Flash-Lite models kept a reduced free tier.

Cost Per Token, Explained

Found this useful?

Share it with someone deciding between AI tools, or get new comparisons like this in your inbox.

Share on X Share on LinkedIn Get weekly AI tool reviews

Every major LLM API bills in units of one million tokens, split into input tokens (the prompt, system instructions, and any retrieved context you send) and output tokens (what the model generates, including any internal reasoning tokens on models with extended thinking). A token is roughly four characters or 0.75 words in English, so 1,000 tokens is close to 750 words.

Output tokens consistently cost more than input tokens across every provider — usually 5 to 6 times more — because generating text requires more compute per token than reading it. That asymmetry is why output-heavy workloads (long-form writing, code generation, detailed explanations) cost disproportionately more than input-heavy ones (classification, extraction, summarization) even on the same model.

The formula for any request is simple: (input tokens ÷ 1,000,000 × input price) + (output tokens ÷ 1,000,000 × output price). The complexity in LLM API pricing in 2026 comes from the modifiers layered on top of that base formula — long-context surcharges, prompt caching discounts, and batch processing discounts — which is where the real cost differences between providers show up.

Long Context and Prompt Caching: The Hidden Multipliers

Two structural differences between the three providers matter more than the headline per-token rate for most production workloads. The first is long-context pricing: OpenAI's GPT-5.4/5.5 family and Google's Gemini 3.1 Pro both roughly double their price once a request crosses a context-length threshold (around 270K tokens for OpenAI, 200K tokens for Gemini 3.1 Pro).

Anthropic's current Claude models — Sonnet 5, Sonnet 4.6, Opus 4.8, Opus 4.7, and Opus 4.6 — include their full 1 million token context window at flat, standard pricing with no premium tier, which changes the calculus for any application working with large codebases, long documents, or extended conversation history.

The second is prompt caching, which every one of the three providers now offers: a cache hit on Anthropic costs 10% of the standard input price (a 90% discount), OpenAI's cached-input rate for GPT-5.4/5.5 runs at roughly 10% of standard input, and Google's Gemini context caching costs about 10% of standard input plus a small per-hour storage fee.

For any application that sends the same system prompt, few-shot examples, or reference document on every request — which describes most production chatbots and coding assistants — enabling caching is usually a bigger cost lever than which provider you pick in the first place. All three providers also offer a 50% batch-processing discount for asynchronous, non-time-sensitive workloads.

A Worked Cost Example: Same Workload, Three Providers

To make the comparison concrete, consider a mid-size production application processing 10 million input tokens and 3 million output tokens per month — a realistic volume for a customer-facing chatbot or coding assistant with moderate traffic, before any caching or batch discounts are applied.

Model Input cost (10M) Output cost (3M) Monthly total
Gemini 2.5 Flash-Lite $1.00 $1.20 $2.20
Claude Haiku 4.5 $10.00 $15.00 $25.00
Gemini 3.5 Flash $15.00 $27.00 $42.00
Claude Sonnet 5 (introductory) $20.00 $30.00 $50.00
Gemini 3.1 Pro Preview (≤200K) $20.00 $36.00 $56.00
GPT-5.4 $25.00 $45.00 $70.00
Claude Sonnet 5 (standard, post-Sep 1) $30.00 $45.00 $75.00
Claude Opus 4.8 $50.00 $75.00 $125.00
GPT-5.5 $50.00 $90.00 $140.00

At this volume, the spread between the cheapest budget-tier model and the most expensive flagship is roughly 64x — a bigger swing than most teams expect until they actually run the numbers. Note that this table does not include Sonnet 5's ~30% tokenizer overhead versus older Claude models, which would push its effective real-world cost somewhat higher than the raw multiplication suggests. It also excludes caching: a chatbot with an 80% cache-hit rate on a shared system prompt could cut most of these totals by a third or more.

Which LLM API Is Cheapest for Indian Developers?

None of the three providers bill in INR or accept UPI for direct API usage — OpenAI, Anthropic, and Google all charge in USD through an international card, which typically adds 2–3.5% in foreign transaction fees, plus 18% GST for GST-registered Indian businesses on top of the converted amount. Using the worked example above, a $50/month Claude Sonnet 5 bill during the introductory period works out to roughly ₹4,150–₹4,300 after typical forex fees, before GST — competitive with Gemini 3.5 Flash's $42/month bill at similar conversion overhead.

For Indian teams and freelance developers testing multiple providers before committing, Google AI Studio's genuinely free access to Gemini 3.5 Flash and Flash-Lite (no card required) remains the lowest-friction way to prototype before any INR conversion cost applies at all. A forex-enabled card from an Indian bank, or a prepaid international card from a fintech like Niyo or Scapia, reduces the repeated conversion fee versus a standard debit card for whichever provider you settle on.

Which LLM API Should You Actually Use?

Choose Gemini 3.5 Flash or Claude Sonnet 5 if: cost-per-quality is the priority and the workload doesn't need the absolute top reasoning tier. Sonnet 5's introductory pricing is the better deal through August 31, 2026, but budget for the tokenizer overhead and the price increase afterward.

Choose Claude Opus 4.8 or GPT-5.5 if: the task genuinely needs frontier-level reasoning — complex multi-step agents, difficult coding tasks, or long-document analysis where a cheaper model produces noticeably worse output. Opus 4.8's flat 1M-context pricing gives it an edge over GPT-5.5 for large-document workloads specifically.

Choose Gemini 3.1 Pro Preview if: the workload genuinely needs a context window beyond what Claude or GPT-5 offer at standard pricing — Gemini 3.1 Pro is the only one of the three with a context window reported up to 2 million tokens.

Route to a budget-tier model (Gemini 2.5 Flash-Lite, Claude Haiku 4.5, or GPT-5.4 mini/nano) whenever the task allows it — classification, extraction, and routing tasks rarely need frontier-level reasoning, and the cost difference at scale is not small.

Developers building on top of any of these APIs — rather than just chatting with them — will find a wider rundown of the models and tooling in AI Nexus's best AI coding tools category, and a deeper look at where AI spend gets wasted on the wrong model tier in the AI Tools Cost & ROI Calculator.

For a broader comparison of these same three model families on capability rather than price, see GPT-5.5 vs Claude Opus 4.8 vs Grok 4. For the earlier snapshot of this same pricing landscape from May 2026 — including Meta's open-source Llama pricing, which is not covered here — see AI Nexus's original AI API Pricing Comparison 2026.

Final Verdict: LLM API Pricing in July 2026

The clearest takeaway from comparing official pricing pages rather than recycled comparison charts: GPT-4o is no longer part of this conversation, and any pricing table that still centers it is working from stale data. The real three-way comparison in July 2026 is GPT-5.4/5.5 versus Claude Sonnet 5/Opus 4.8 versus Gemini 3.1 Pro/3.5 Flash.

On that comparison, Claude Sonnet 5's introductory rate and Gemini 3.5 Flash are the two most cost-effective frontier-adjacent options, Claude and Gemini both beat OpenAI on flat long-context pricing or free-tier access respectively, and every provider now offers roughly the same caching and batch discounts. The single biggest cost lever for any real application, regardless of which provider you pick, is still routing simple tasks to a cheaper model and enabling prompt caching on anything with a repeated system prompt.

Frequently Asked Questions

Is GPT-4o pricing still relevant in 2026?

Not for new integrations. OpenAI retired GPT-4o from ChatGPT entirely by April 3, 2026, and as of July 2026 GPT-4o no longer appears on OpenAI's official API pricing page alongside the current GPT-5.5 and GPT-5.4 families. Existing API integrations may still route to legacy GPT-4o endpoints depending on account history, but OpenAI has been clear that GPT-5.4 and GPT-5.5 are the models developers should use for any current pricing comparison. If a comparison chart still lists GPT-4o at $2.50/$10 per million tokens as OpenAI's current flagship rate, treat it as outdated — that was accurate earlier in 2026 but does not reflect OpenAI's current lineup.

What is the cheapest LLM API in 2026?

Among frontier-tier, general-purpose models, Gemini 3.5 Flash ($1.50/$9.00 per million input/output tokens) and Claude Sonnet 5 ($2.00/$10.00 introductory, through August 31, 2026) are the two cheapest capable options. For pure budget routing on simple tasks like classification or extraction, Gemini 2.5 Flash-Lite ($0.10/$0.40 per million tokens) and Claude Haiku 4.5 ($1.00/$5.00) are considerably cheaper, but they trade off reasoning depth. The right "cheapest" answer depends on whether the task needs frontier-level reasoning or can be routed to a smaller model.

How much does the Claude API cost per million tokens in 2026?

Claude Sonnet 5 costs $2.00 input / $10.00 output per million tokens through an introductory period ending August 31, 2026, after which it moves to $3.00/$15.00 — the same rate as Claude Sonnet 4.6. Claude Opus 4.8 costs $5.00/$25.00, and Claude Haiku 4.5 costs $1.00/$5.00. All current-generation Claude models include a full 1 million token context window at standard pricing with no long-context surcharge, and prompt caching cuts cache-hit input cost by 90% across the board.

Is Gemini cheaper than GPT-5 and Claude for API use?

At the flagship tier, Gemini 3.5 Flash ($1.50/$9.00) undercuts GPT-5.4 ($2.50/$15.00) and matches or beats Claude Sonnet 5's post-introductory rate ($3.00/$15.00), while Gemini 3.1 Pro Preview ($2.00/$12.00 up to 200K tokens) sits between the two on price. Google also offers a genuinely free tier for Flash and Flash-Lite models with reduced rate limits, which neither OpenAI nor Anthropic currently matches for their current-generation models. Google's Pro-tier models, however, lost free-tier access entirely as of April 1, 2026 — Gemini 3.1 Pro Preview is paid-only.

What is prompt caching and how much does it save on LLM API costs?

Prompt caching lets an API reuse a previously processed prompt prefix (a system prompt, a long document, or few-shot examples) instead of reprocessing it on every request, billing the cached portion at a steep discount. Anthropic charges just 10% of standard input price for a cache hit (a 90% saving) after an initial 1.25x-cost cache write. OpenAI's GPT-5.4 and GPT-5.5 families offer a similar 90% cached-input discount. Google's Gemini context caching runs at roughly 10% of standard input price plus a small hourly storage fee. For any application with a stable system prompt sent on every request, caching is usually the single biggest lever for cutting LLM API costs — bigger than choosing between providers.

How much does LLM API usage cost in India after GST and currency conversion?

None of the three providers bill in INR or accept UPI for API usage — OpenAI, Anthropic, and Google all charge in USD via international card, which typically adds 2–3.5% in foreign transaction fees, and 18% GST applies for GST-registered Indian businesses on top of the converted amount. For budgeting, a $50/month API bill on any of the three providers works out to roughly ₹4,150–₹4,300 after typical forex fees, before GST. A forex-enabled card from an Indian bank, or a fintech card from a provider like Niyo or Scapia, reduces the repeated conversion fee compared to a standard debit card.

Related Comparisons