GPT-5.6 Sol charges 6x its input rate for output tokens. Grok 4.3 charges 2x. Claude Sonnet 5 is $2/M input through August 31, 2026, then jumps to $3/M on September 1. None of that shows up if you're comparing "input price" across providers in your head, and it's exactly the kind of gap that turns a reasonable model choice into a 5x cost overrun once your workload ships. This LLM API pricing comparison puts every major provider's cost per million tokens into one table, shows you how to compute your own blended rate instead of trusting a headline number, and marks where self-hosting on GPU cloud actually beats the API.
LLM API Pricing Comparison Table 2026: Cost Per Million Tokens by Provider
Direct answer: as of August 2026, DeepSeek V4-Flash is the cheapest listed API at $0.14/M input and $0.28/M output, and GPT-5.6 Sol is the most expensive flagship at $5/M input and $30/M output. Between those extremes sit six other providers, each with its own input:output ratio, context-length pricing tiers, and caching mechanics that change the real cost far more than the headline number suggests.
| Provider | Model | Input $/M | Output $/M | Notes |
|---|---|---|---|---|
| OpenAI | GPT-5.6 Sol | $5.00 | $30.00 | Flagship, GA July 9, 2026 |
| OpenAI | GPT-5.6 Terra | $2.00 | $12.00 | Mid-tier of the 5.6 family |
| OpenAI | GPT-5.6 Luna | $0.20 | $1.20 | Budget tier |
| OpenAI | GPT-5.4 | $2.50 | $15.00 | Cached input $0.25/M |
| OpenAI | GPT-5.4-mini | $0.75 | $4.50 | |
| Anthropic | Claude Sonnet 5 | $2.00 | $10.00 | Introductory, through Aug 31, 2026 |
| Anthropic | Claude Sonnet 5 | $3.00 | $15.00 | Standard, from Sept 1, 2026 |
| Anthropic | Claude Opus 5 / Opus 4.8 | $5.00 | $25.00 | Full 1M context at standard rate |
| Anthropic | Claude Haiku 4.5 | $1.00 | $5.00 | |
| Gemini 3.1 Pro | $2.00 | $12.00 | Prompts up to 200k tokens | |
| Gemini 3.1 Pro | $4.00 | $18.00 | Prompts over 200k tokens | |
| Gemini 3.5 Flash-Lite | $0.30 | $2.50 | Flat rate regardless of length | |
| DeepSeek | V4-Flash | $0.14 | $0.28 | Cache hit: $0.0028/M |
| DeepSeek | V4-Pro | $0.435 | $0.87 | Cache hit: $0.003625/M |
| xAI | Grok 4.5 | $2.00 | $6.00 | Prompts under 200k tokens |
| xAI | Grok 4.5 | $4.00 | $12.00 | Prompts at or over 200k tokens |
| xAI | Grok 4.3 | $1.25 | $2.50 | Prompts under 200k tokens |
| xAI | Grok 4.3 | $2.50 | $5.00 | Prompts at or over 200k tokens |
| Mistral | Medium 3.5 | $1.50 | $7.50 | |
| Mistral | Large 3 | $0.50 | $1.50 | |
| Mistral | Small 4 | $0.15 | $0.60 |
Sources: Anthropic pricing docs, OpenAI pricing docs, Google Gemini API pricing, DeepSeek pricing docs, xAI model docs, Mistral API pricing.
A few things this table doesn't show that matter as much as the numbers in it. OpenAI's Batch API cuts every rate above by 50%, and any regional data-residency endpoint on a model released on or after March 5, 2026 adds a flat 10% uplift on top. Anthropic's prompt caching drops a cache hit to 0.1x the base input price, a 5-minute cache write costs 1.25x, and a 1-hour write costs 2x, all of which stack with its own 50%-off Batch API. Google's context caching typically cuts 80-90% off standard Gemini rates, and its Batch API is also 50% off. DeepSeek's cache-hit rate on V4-Flash, $0.0028/M, is roughly 1,785x cheaper than Claude Opus 5's $5/M base input rate, and 100x cheaper than V4-Flash's own $0.28/M output rate, which is exactly why cache-hit, cache-miss, and output need to be tracked as three separate line items rather than folded into one "price" per provider.
DeepSeek is also mid-transition: its legacy deepseek-chat and deepseek-reasoner model names retired on July 24, 2026 and now remap to V4-Flash's non-thinking and thinking modes. And DeepSeek has announced, but not yet confirmed a rollout date for, a peak/off-peak policy that doubles prices during 9:00-12:00 and 14:00-18:00 Beijing time daily. If your workload runs on a schedule that overlaps those windows, budget for the peak rate, not the off-peak one shown in the table.
The table above is the snapshot that matters more than any trend line: what you'll actually be billed this month, per provider, per model, at the rate that's live today.
How Blended Rate Is Calculated: The Real Math Behind an LLM API Pricing Comparison
A headline "$X/M input" number tells you almost nothing about what you'll pay, because real traffic mixes input and output tokens, and providers price output at wildly different multiples of input. The formula:
Blended rate = (input token share x input price) + (output token share x output price)Run it across three common workload shapes, from input-heavy (RAG with long retrieved context, short answers) to output-heavy (long-form generation, extended chain-of-thought reasoning):
| Provider | 80/20 (input-heavy) | 50/50 (balanced) | 20/80 (output-heavy) |
|---|---|---|---|
| DeepSeek V4-Flash | $0.17/M | $0.21/M | $0.25/M |
| Gemini 3.5 Flash-Lite | $0.74/M | $1.40/M | $2.06/M |
| Grok 4.3 (<200k) | $1.50/M | $1.88/M | $2.25/M |
| GPT-5.4-mini | $1.50/M | $2.63/M | $3.75/M |
| Claude Sonnet 5 (intro) | $3.60/M | $6.00/M | $8.40/M |
| GPT-5.4 | $5.00/M | $8.75/M | $12.50/M |
| Claude Opus 5 | $9.00/M | $15.00/M | $21.00/M |
| GPT-5.6 Sol | $10.00/M | $17.50/M | $25.00/M |
Watch Grok 4.3 and GPT-5.4-mini: they're tied at $1.50/M on an input-heavy split, but by 20/80 they've split to $2.25/M and $3.75/M. That's not noise, it's the output multiplier. GPT-5.4-mini charges output at 6x its input rate; Grok 4.3 charges it at just 2x. A provider with a flat input:output ratio looks unremarkable on a chat-style workload and pulls ahead fast on anything that generates a lot of text: agentic tool-call traces, long-form drafting, or extended reasoning chains where output tokens dominate the bill.
The practical rule: pull your actual input and output token counts from production logs before you pick a provider on price. A 3-5x swing in effective cost between two providers with similar headline rates is common once you compute the real ratio for your workload, and it's the single most common mistake in comparing "cheap" APIs against each other.
Where Self-Hosting Beats Every API on This List
None of the rates above are a floor. At high enough sustained volume, renting a GPU and running the model yourself gets cheaper than any API on this table, but exactly where that crossover lands depends entirely on the API's blended rate and how much hardware the self-hosted alternative needs.
Live Spheron on-demand pricing, checked 06 Aug 2026: H100 SXM5 from $2.98/hr ($2.07/hr spot), H200 SXM5 from $4.96/hr ($3.31/hr spot). Self-hosted cost per million tokens comes down to (cluster $/hr) / (tokens/sec x 3600 / 1,000,000), the same formula our GPU cost-per-token benchmarks use across seven models and five GPU types. Multiply that by your daily token volume and compare it against the API's blended rate from the table above, and you get a real crossover point instead of a rule of thumb.
The crossover moves by two orders of magnitude depending on which API you're replacing, because it's driven by both the API's blended rate and the self-hosted model's minimum viable cluster size:
- Against Claude Opus 4.8 ($9.00/M blended at 80/20): our Claude Opus 4.8 self-hosting breakdown puts the crossover at roughly 31-36M tokens/day on a budget INT4/spot cluster, and 105-108M tokens/day on a production FP8/on-demand cluster, because Opus-class open alternatives like DeepSeek V4 need a real 4-to-8-GPU cluster, not one card.
- Against GPT-6 (an earlier OpenAI flagship at a different price point): our GPT-6 self-hosting breakdown found the crossover at roughly 16M tokens/day on a single H100 on-demand and roughly 22M tokens/day on a single H200, since the open-weight alternatives it compared against fit on one GPU.
- Against DeepSeek's own API (already the cheapest row in the table): our DeepSeek self-hosting breakdown puts the crossover around 831M tokens/day on spot and 933M tokens/day on-demand. When the API is already this cheap per token, self-hosting only wins at genuinely enormous scale.
The pattern holds generally: the cheaper the API's blended rate, the higher the daily volume has to climb before a rented GPU cluster beats it, and the fewer GPUs the open alternative needs to fit in VRAM, the lower that crossover falls. For a full accounting of what feeds into that decision beyond the token math, our AI inference cost economics post covers the FinOps side, and the GPU requirements cheat sheet has concrete GPU-count minimums for the open-weight models most teams land on. If you're already convinced and just need the provider-switch mechanics, our migrating off the OpenAI API guide covers that specific move, and Spheron's docs cover instance provisioning and SSH setup for the first deploy.
Pricing fluctuates based on GPU availability. The prices above are based on 06 Aug 2026 and may have changed. Check current GPU pricing → for live rates.
Cheapest Provider by Workload Shape: Chat, Long-Context, and Batch
There's no single "cheapest" provider once you account for how your workload actually behaves. Three shapes cover most production traffic, and each favors a different row in the table above.
Chat and short-turn workloads (low output per turn, frequent requests) favor the lowest blended rate at an input-heavy ratio: DeepSeek V4-Flash on a cache hit, Gemini 3.5 Flash-Lite, GPT-5.4-mini, or Mistral Small 4 at $0.15/$0.60. These are the rows that stay cheap even without caching or batching discounts layered on top.
Long-context workloads (over 200k tokens per request) flip the ranking in a way headline prices hide. Gemini 3.1 Pro doubles its rate past 200k tokens ($2/$12 to $4/$18), and Grok 4.5 and Grok 4.3 both double as well. Claude's Opus 4.8, Opus 5, and Sonnet 5 include the full 1M-token context window at standard pricing with no long-context surcharge tier at all, a real structural advantage once your prompts routinely exceed 200k tokens, even though Claude's headline per-token rate looks higher on a short prompt.
Batch and async workloads (offline classification, nightly enrichment, bulk summarization) stack whichever discounts are available. OpenAI, Anthropic, and Google all offer a flat 50% off both input and output on their Batch APIs. Combine that with caching, Anthropic's cache-hit multiplier alone drops input to 0.1x, and the input-token portion of a batch job can fall by up to 95% versus standard uncached, synchronous pricing, though output tokens only get the flat batch discount, so your overall blended savings land lower than that input-only figure.
Llama Is the Exception: Why There's No Single "Llama API Price"
Every provider in the table above sells its own model through its own API at its own listed rate. Llama doesn't work that way, and that's worth understanding before you go looking for a "Llama pricing page" that doesn't exist.
Meta doesn't sell first-party Llama API access at all. There's no platform.claude.com or developers.openai.com equivalent for Llama; instead, every Llama rate you'll find comes from a third-party host, Groq, Together AI, Fireworks, Deepinfra, and others, each running the open-weight model on its own hardware at its own margin. The same Llama model can carry meaningfully different per-token rates across hosts, and none of those rates is "the" Llama price the way $5/$30 is "the" GPT-5.6 Sol price.
That host-dependency cuts both ways. Our Groq API pricing vs GPU rental breakdown runs the same crossover math this post applies to Claude and GPT, but for LPU-based serving instead of a closed foundation model. And because there's no first-party API to compare against, self-hosting Llama yourself is a more common default than it is for GPT or Claude; our Llama Stack deployment guide covers standing it up on rented GPU cloud directly, which sidesteps the third-party host question entirely.
Whatever your blended rate works out to, the fastest way to know if self-hosting makes sense is to run your actual token volume against live GPU pricing instead of a rule of thumb.
Check current GPU pricing → | H100 GPU pricing → | Get started on Spheron →
Frequently Asked Questions
By list price, DeepSeek V4-Flash is the cheapest broadly-available API: $0.14/M input on a cache miss, $0.0028/M on a cache hit, and $0.28/M output, with a 1M-token context window (source: api-docs.deepseek.com). At an 80/20 input:output split that blends to $0.168/M uncached, roughly 4x cheaper than Gemini 3.5 Flash-Lite ($0.30/$2.50, blends to $0.74/M) and over 21x cheaper than Claude Sonnet 5's introductory rate ($2/$10, blends to $3.60/M). The caveat: DeepSeek has announced a peak/off-peak policy that doubles prices during 9:00-12:00 and 14:00-18:00 Beijing time once it rolls out, so check current status before budgeting off the off-peak number alone.
Blended cost per million tokens = (input token share x input price) + (output token share x output price). For a workload that's 80% input tokens and 20% output tokens on GPT-5.4 ($2.50/M input, $15/M output): (0.8 x $2.50) + (0.2 x $15.00) = $2.00 + $3.00 = $5.00/M blended. Always compute this on your own actual input:output ratio from production logs, not a generic assumption, since the ratio can swing the blended rate by 5x or more between providers.
Because each provider prices output at a different multiple of its input rate, and that multiple decides who wins as output share rises. GPT-5.6 Sol charges 6x its input rate for output ($5 to $30/M); Claude Opus 5 charges 5x ($5 to $25/M); Grok 4.3 charges only 2x ($1.25 to $2.50/M). At an 80/20 input-heavy split, GPT-5.4-mini and Grok 4.3 tie at roughly $1.50/M blended. Flip to a 20/80 output-heavy split, typical of long-form generation or extended reasoning traces, and Grok 4.3 drops to $2.25/M while GPT-5.4-mini rises to $3.75/M. The provider with the flatter input-to-output multiplier wins as output share grows, regardless of headline input price.
No. Meta doesn't sell first-party Llama API access, so there's no equivalent to platform.claude.com or developers.openai.com pricing pages for Llama. Every listed Llama rate comes from a third-party host (Groq, Together AI, Fireworks, Deepinfra, and others), and each sets its own price based on its own hardware and margins, so the same Llama model can carry meaningfully different rates depending on which host you pick.






