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. It costs $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 hasn't caught up with reality. GPT-4o has been retired from ChatGPT entirely and dropped off OpenAI's own pricing table. 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. Its heavier tokenizer does eat into that headline discount on real workloads, though.
— Navneet Arya, AI Nexus

This is a developer reference post with no affiliate links — every "Visit API" link below goes straight to the vendor. See our affiliate disclosure for how we handle sponsored links elsewhere on the site.

How to Pick the Right Model for Cost

  1. Match the model to the task first, not the price. A cheap model that fails the task costs more in retries than a pricier one that gets it right the first time.
  2. Route simple tasks to a budget-tier model. Classification, extraction, and routing rarely need frontier-level reasoning — use Gemini 2.5 Flash-Lite or Claude Haiku 4.5 there.
  3. Turn on prompt caching if you have a stable system prompt. This is usually the single biggest cost lever available, bigger than which provider you pick.
  4. Check the long-context surcharge before you commit. OpenAI and Google both roughly double their price past a token threshold; Anthropic's flat 1M-token pricing avoids that entirely.
  5. Re-run the math before Sonnet 5's introductory window ends. Its rate rises 50% on September 1, 2026 — budget for that if you're building on it now.
Visit Anthropic API →

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. 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. The last bit, through Custom GPTs on Business, Enterprise, and Edu plans, ended April 3, 2026.

Check OpenAI's own pricing page today and GPT-4o is nowhere in the current tables, next to 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. A lot of "GPT-4o vs Claude vs Gemini" posts online still quote its old $2.50/$10.00 rate, as if that were still OpenAI's flagship price. It is not.

This guide uses the numbers OpenAI, Anthropic, and Google publish today, checked against each provider's own pricing page. It 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 bills per million tokens, split into input (what you send) and output (what it generates back). Rates shown are standard, non-batch, non-cached — the starting point, before any of the cost-cutting levers covered below.

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 has two tiers. GPT-5.5 runs $5.00 input / $30.00 output per million tokens, with a $0.50 cached-input rate. GPT-5.4 is the mid-tier option at $2.50/$15.00. Both roughly double their rate once a request crosses a long-context threshold — around 270,000 tokens for GPT-5.5/5.4.

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 isn't listed in OpenAI's current pricing docs at all. That's a real shift from earlier in 2026, when it still showed up 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 and Claude Haiku 4.5 at $1.00/$5.00. Claude Sonnet 5 costs an introductory $2.00/$10.00 through August 31, 2026. After that it reverts to $3.00/$15.00, the same rate as the outgoing Sonnet 4.6.

One thing headline pricing tables tend to miss: Sonnet 5, plus Opus 4.7 and later, uses a newer tokenizer. It produces roughly 30% more tokens for the same input text than the previous generation did.

That means the real cost on Sonnet 5 can land higher than the raw rate implies, even at the discounted introductory price.

Anthropic is also the only one of the three providers with a full 1 million token context window at flat, standard pricing. There's no long-context surcharge, unlike with 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. It has been paid-only since April 1, 2026, when Google removed free-tier access to its Pro-class models.

Gemini 3.5 Flash, launched at Google I/O 2026, costs $1.50/$9.00 with no context-length pricing tiers. It also has a genuine free tier with lower rate limits — something neither OpenAI's nor Anthropic's flagship models offer. 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 hasn't stood still this year, and the direction 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.

That reflects OpenAI pricing its most capable model as a genuine premium tier, not a like-for-like swap. GPT-5.4 at $2.50/$15.00 is the closer match to what GPT-4o used to cost.

Anthropic moved the opposite way 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 across four straight releases.

Google's biggest 2026 change wasn't a price cut. It was a free-tier restriction: Gemini Pro-class models lost free access entirely on April 1, 2026. That pushed anyone prototyping with Gemini 3.1 Pro onto a paid account, though Flash and Flash-Lite 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 and output tokens. Input tokens cover the prompt, system instructions, and any context you send.

Output tokens are what the model generates back, including internal reasoning tokens on extended-thinking models. A token is roughly four characters, or 0.75 words in English — so 1,000 tokens is close to 750 words.

Output tokens always cost more than input tokens, usually 5 to 6 times more. Generating text just takes more compute per token than reading it. That's why output-heavy work — long-form writing, code, detailed answers — costs a lot more than input-heavy work like classification or summarizing, 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 real complexity comes from what's layered on top: long-context surcharges, caching discounts, and batch discounts. That's 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. That's 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, Opus 4.6 — all get the full 1M token window at flat, standard pricing. There's no premium tier. That's a real difference for any app working with big codebases, long documents, or long chat 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 the same 10% of standard input. Google's Gemini context caching costs about 10% of standard input too, plus a small per-hour storage fee.

Most chatbots and coding assistants send the same system prompt, examples, or reference doc on every single request. For that kind of app, turning on caching is usually a bigger cost lever than which provider you pick at all. All three providers also offer a 50% batch-processing discount for asynchronous, non-time-sensitive workloads.

A Worked Cost Example: Same Workload, Three Providers

Here's a concrete example: a mid-size app processing 10 million input tokens and 3 million output tokens a month. That's a realistic volume for a chatbot or coding assistant with moderate traffic, before caching or batch discounts kick in.

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 priciest flagship is roughly 64x. That's a bigger swing than most teams expect until they run the numbers.

Note: this table skips Sonnet 5's ~30% tokenizer overhead versus older Claude models. Real cost lands a bit higher than the raw math shows. 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 adds 2–3.5% in forex fees. GST-registered Indian businesses also pay 18% GST on top of the converted amount.

From the example above, a $50/month Sonnet 5 bill at the intro rate works out to roughly ₹4,150–₹4,300 after forex fees, before GST. That's competitive with Gemini 3.5 Flash's $42/month bill at similar conversion overhead.

For Indian teams testing providers, Google AI Studio gives free access to Gemini 3.5 Flash and Flash-Lite, no card needed. It's the lowest-friction way to prototype before any INR conversion cost applies.

A forex-enabled card from an Indian bank, or a prepaid card from a fintech like Niyo or Scapia, helps too. Either cuts the repeated conversion fee versus a standard debit card, 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 task doesn't need the top reasoning tier. Sonnet 5's introductory rate is the better deal through August 31, 2026. Budget for the tokenizer overhead and the price hike after that, though.

Choose Claude Opus 4.8 or GPT-5.5 if: the task genuinely needs frontier-level reasoning. Think complex agents, hard coding tasks, or long-document work, where a cheaper model gives 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: your workload needs a bigger context window than 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 rarely need frontier-level reasoning. The cost gap at scale adds up fast.

Building on these APIs, not just chatting with them? See a wider rundown in AI Nexus's best AI coding tools category. For a deeper look at where AI spend gets wasted on the wrong model tier, see the AI Tools Cost & ROI Calculator.

For a broader look at these three families on capability, not 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, see AI Nexus's original AI API Pricing Comparison 2026. It also covers Meta's open-source Llama pricing, which isn't included here.

Visit OpenAI API → Visit Anthropic API → Visit Google AI Studio →

Final Verdict: LLM API Pricing in July 2026

The clearest takeaway from the official pricing pages, not recycled charts: GPT-4o is no longer part of this conversation. 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, Sonnet 5's intro rate and Gemini 3.5 Flash are the two best-value options near the frontier tier. Claude and Gemini both beat OpenAI, on flat long-context pricing and free-tier access respectively. Every provider now offers roughly the same caching and batch discounts too.

The single biggest cost lever, whichever provider you pick, is still routing simple tasks to a cheaper model. Turning on prompt caching for a repeated system prompt is the other one.

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