LLM API Pricing (2026): What Every Model Actually Costs Per Token

Every major LLM API rate as of July 2026, per million tokens. Claude Opus 4.8 is $5/$25, GPT-5.6 is $5/$30, Gemini 3.1 Pro is $2/$12 (doubling above 200K), Grok 4.5 is $2/$6. Open models on Fireworks, Together, DeepInfra, Groq, and Cerebras run 10-50x cheaper. The cheapest credible API is DeepSeek V4 Flash at $0.139/$0.278 on Morph. Includes the pricing models (per-token, per-GPU-minute, subscription), the traps (long-context tiering, quantization, cache mechanics), and worked cost-per-task math.

July 17, 2026 · 8 min read

Sticker price is not cost. The pricing page tells you $/M tokens; your bill tells you a different number, because one host runs a model at FP8 and another at FP4, one tiers long context and one does not, one counts reasoning tokens and one hides them. This page collects every current LLM API rate as of July 2026, sourced and dated, and explains where the sticker price and the real cost diverge.

$5 / $25
Claude Opus 4.8 per MTok (in / out)
$2 / $12
Gemini 3.1 Pro per MTok (≤200K)
$0.139 / $0.278
DeepSeek V4 Flash on Morph per MTok
36x
Frontier-to-cheapest input price gap

The Cheapest LLM API in 2026

The honest answer to "cheapest LLM API" depends on whether you need a frontier-capable model. If you do, the cheapest credible option is DeepSeek V4 Flash at $0.139 input / $0.278 output per million tokens on Morph, with a 1M-token context window. That is roughly 36x cheaper on input than Claude Opus 4.8 for a model that runs a real agent loop, not a toy.

Among open-model hosts, DeepInfra lists DeepSeek V4 Flash at $0.09/$0.18 and the tiny Llama 3.1 8B at $0.02/$0.03. Smaller models go lower per token, but an 8B model is not frontier-capable. For a DeepSeek-class model that can drive an agent, DeepInfra and Morph are the two honest anchors at the bottom of the market.

$0.139
Input per million tokens on DeepSeek V4 Flash. The same 1M input tokens cost $5.00 on Claude Opus 4.8, $5.00 on GPT-5.6, and $2.00 on Gemini 3.1 Pro.
Morph pricing / provider pricing pages, July 2026
Cheapest general-purpose LLM APIs (per MTok, July 2026)
Model / HostInputOutputContextNote
DeepSeek V4 Flash (Morph)$0.139$0.2781MFrontier-capable, agent-ready
DeepSeek V4 Flash (DeepInfra)$0.09$0.18128KCheapest listed DeepSeek SKU
Qwen 3.6 27B (Morph)$0.289$2.40131KSmall fast coder
gpt-oss-120b (DeepInfra)$0.037$0.17131KCheapest open flagship
Llama 3.1 8B (DeepInfra)$0.02$0.03128KNot frontier-capable
Gemini 3.1 Flash-class~$0.30~$2.501MCheapest closed frontier tier
Cheapest per token is not cheapest per task

A model priced at $0.02/M input can still cost more per finished task than one at $0.14/M if it needs three attempts where the better model needs one, or if it burns 4x the reasoning tokens to reach the same answer. Price the task, not the token. The worked example below shows how the sticker gap compresses once you account for what a real agent loop actually consumes.

Closed Frontier Model Pricing (July 2026)

The four closed frontier labs (Anthropic, OpenAI, Google, xAI) price per token, billed separately for input and output, with a discounted cache-read rate. The headline flagship rates cluster tightly at $2-$5 input. The divergence is in the details: long-context tiering, cache mechanics, and output multiples. Numbers below are from each provider's official pricing page, observed July 17, 2026.

Frontier LLM API pricing (per MTok, July 2026)
ModelInputOutputCache readContext
Claude Opus 4.8$5.00$25.00$0.501M
Claude Sonnet 5$3.00$15.00$0.301M
Claude Haiku 4.5$1.00$5.00$0.10200K
GPT-5.6 (sol)$5.00$30.00$0.50400K
GPT-5.4 mini$0.75$4.50$0.075400K
Gemini 3.1 Pro (≤200K)$2.00$12.00$0.201M
Gemini 3.1 Pro (>200K)$4.00$18.00$0.401M
Grok 4.5 (<200K)$2.00$6.00$0.50500K
Grok 4.5 (≥200K)$4.00$12.00$1.00500K

Two facts do most of the work when you compare these. First, output costs 3-6x input across the board, so a chatty model or a verbose reasoning trace hurts more than a long prompt. Second, Gemini and Grok double their rates above a 200K-token request; Claude and OpenAI keep the full window flat. On a 300K-token request, Gemini bills every token at $4/M input while Claude stays at $5/M flat, which flips the "Gemini is cheaper" conclusion you would draw from the headline rate.

Per-provider deep dives, with every model tier and the pricing-page source: Anthropic API pricing, OpenAI API pricing, Gemini API pricing, and Grok API pricing.

Model IDs move fast

OpenAI's current family is GPT-5.6 (the earlier GPT-5.5 is still listed at $5/$30). Grok 4.5 superseded Grok 4 in early July; classic Grok 4 was $3/$15 on a 256K window. Claude Sonnet 5 runs a $2/$10 introductory rate through Aug 31, 2026, then $3/$15. Always confirm the live model ID and rate on the provider's page before you commit a budget to it.

Open-Model Provider Pricing (July 2026)

The same open weights (DeepSeek, Llama, Qwen, GLM, gpt-oss, Kimi) run 10-50x cheaper than the closed frontier, because you are paying for inference compute, not a research lab's margin. The catch is that price varies across hosts for reasons the model name hides: quantization, GPU generation, and utilization. Representative per-token rates below, per official pricing pages, July 17, 2026.

Open-model serverless pricing (per MTok, July 2026)
Providergpt-oss-120bDeepSeek V4 (Pro/Flash)GLM-5.2Model
DeepInfra$0.037 / $0.17$1.30/$2.60 · $0.09/$0.18$0.93 / $3.00Cheapest per token
Groq$0.15 / $0.60not hostednot hostedLPU, ~500 tok/s
Fireworks AI$0.15 / $0.60$1.74/$3.48 · $0.14/$0.28$1.40 / $4.40Broad catalog
Together AI$0.15 / $0.60$1.74/$3.48$1.40 / $4.40Broad catalog
Baseten$0.10 / $0.50$1.74/$3.48$1.40 / $4.40Model APIs + dedicated
Novita AI$0.05 / $0.25$1.60/$3.20 · $0.14/$0.28$1.40 / $4.40Per-token + GPU
Cerebras$0.35 / $0.75not hostedGLM-4.7 $2.25/$2.75Wafer-scale, ~3,000 tok/s

The pattern: DeepInfra and Novita sit at the bottom on price; Fireworks, Together, and Baseten cluster in the middle with broad catalogs and dedicated-endpoint options; Groq and Cerebras charge more per token but deliver custom-silicon speed (Groq's LPU, Cerebras's wafer-scale engine). The DeepSeek V4 Pro list price of $1.74/$3.48 is shared verbatim across Fireworks, Together, and Baseten, likely DeepSeek's own reference rate; DeepInfra ($1.30/$2.60) and Novita ($1.60/$3.20) undercut it.

Per-provider breakdowns: Fireworks AI pricing, Together AI pricing, Baseten pricing, DeepInfra pricing, and Cerebras pricing.

OpenRouter is a pass-through, not a price

OpenRouter is an aggregator: it routes each request to the cheapest stable provider and passes the provider's listed price through with zero inference markup. It makes money on a fee at credit purchase (about 5.5% + $0.80 by card, 5% by crypto) and on bring-your-own-key usage above a monthly free allowance. So an OpenRouter rate is really the underlying provider's rate plus a small credit fee, not a distinct price tier.

Morph Fast General Coding Model Pricing

Morph serves open frontier models on custom kernels through one OpenAI-compatible API. Rates below are the canonical Morph prices as of July 2026. DeepSeek V4 Flash at $0.139/$0.278 is the cheapest general-purpose model in this guide; GLM 5.2 gives you a 1M-token window at $1.10/$4.10.

Morph model pricing (per MTok, July 2026)
ModelInputCached inputOutputContext
DeepSeek V4 Flash$0.139$0.2781M
Qwen 3.6 27B$0.289$2.40131K
Qwen 3.5 397B$0.50$0.30$3.50262K
MiniMax M3 428B$0.60$2.40256K
GLM-5.2 744B$1.10$0.22$4.101M

The full lineup and per-model pages: GLM-5.2, DeepSeek V4 Flash, Qwen 3.5, Qwen 3.6, MiniMax M3, and Kimi. Live per-token rates are generated from the source of truth and served as JSON at /api/models/json.

The Five Pricing Models, Explained

"What does it cost" has five different answers depending on how the provider sells compute. Knowing which model you are on decides whether the headline rate is the number you will actually pay.

How LLM inference is priced
Pricing modelWho uses itYou pay forBest when
Per tokenClaude, GPT, Gemini, Grok, serverless open-model APIsInput + output tokens, no idle costBursty or low-volume traffic
Per GPU-minute / hourBaseten dedicated, Together/Fireworks/DeepInfra endpointsRented GPU time (H100 ~$2.20-$7/hr, B200 ~$3.69-$10/hr)High sustained utilization
SubscriptionCerebras Code ($50-$200/mo)Flat fee, capped daily tokensOne developer, steady daily coding
Credits + feeOpenRouterProvider pass-through rate + purchase fee (~5%)Multi-provider access from one key
Serve-only / downloadEnterprise online learningCustom checkpoint, negotiated rateSelf-improving on your own traffic

The break-even between per-token and per-GPU-minute is utilization. A dedicated H100 at $2.20/hour costs about $1,584/month running full-time. If your per-token bill for the same throughput is lower than that, stay serverless. Once you are saturating a GPU most hours of the day, dedicated wins, and you also get predictable latency instead of shared-queue variance. Morph runs the same math for customers on dedicated deployments: over 100 billion tokens a day run this way, with speculators trained on the customer's traffic and volume rates below public per-token.

Long-Context Tiering: Who Charges It, Who Does Not

The single most expensive surprise on an LLM bill is long-context tiering. Two of the four frontier labs charge a higher rate once a request crosses 200K tokens, and they charge it on every token in the request, not just the overflow past 200K.

Long-context pricing behavior (July 2026)
ProviderTiers long context?ThresholdMultiplier
Google Gemini 3.1 ProYes200K tokens~2x input and output
xAI Grok 4.5Yes200K tokens~2x input and output
Anthropic ClaudeNoFlat to 1M1x
OpenAI GPT-5.6NoFlat to 400K1x
Most open-model hostsNoFlat to model max1x

The consequence: a 250K-token request on Gemini 3.1 Pro bills at $4/M input, not $2/M, so the same request that would look cheaper than Claude at the headline rate is actually near parity or worse once the window opens. If your workload routinely sends large contexts (whole repositories, long transcripts, RAG with many chunks), a "cheaper" tiered provider can cost more than a flat-rate one. Or you compact the context first so you never cross the threshold, which is the point of Morph Compact.

Cache-Hit Pricing: The Biggest Free Discount

Every frontier provider discounts repeated content. An agent re-sends its system prompt and conversation history on every turn; caching lets the model skip recomputing the repeated prefix and charges a fraction of the base input rate for it. The mechanism differs by provider, and the difference matters.

Cache-hit pricing and mechanism (July 2026)
ProviderCache readWrite premiumMechanism
Anthropic Claude0.1x base (~90% off)1.25x-2xExplicit cache_control markers
OpenAI GPT0.1x base (~90% off)NoneAutomatic on 1K+ token prefixes
Google Gemini$0.20-$0.40/M + $4.50/hr storageNoneAutomatic + hourly storage fee
xAI Grok$0.50/M ($1.00 above 200K)NoneAutomatic

Anthropic is the only one that charges a write premium (you pay 1.25x-2x to put content in the cache) and the only one that requires you to mark content explicitly with cache_control. OpenAI and Grok cache automatically with no write cost, but you have less control over what gets cached. Gemini caches automatically but adds an hourly storage fee, so it only pays off if the cached prefix is reused quickly. For an agent with a stable 2K-token system prompt sent 200 times a session, caching cuts the system-prompt portion of the bill by about 90% on Anthropic and OpenAI.

Sticker Price vs Effective Cost

The rate on the pricing page is the sticker. The effective cost is what lands on your bill after four things the sticker does not show.

Why effective cost diverges from sticker price
Hidden factorWhat it doesWho it hits
Reasoning / verbosity tokensReasoning models emit hidden thinking tokens you pay for at the output rateGPT reasoning tiers, Gemini thinking, any verbose model
Quantization differencesFP4 host is cheaper than FP8 host for the same model name, but output quality differsOpen-model hosts serving the same weights
Long-context tieringRates double above 200K on some providers, on every tokenGemini, Grok on large requests
Rate limits forcing higher tiersFree/low tiers throttle agents, pushing you to a paid tier sooner than the token math impliesCerebras free (5 RPM), most free tiers

The verbosity trap is the one most teams miss. A model that costs $2/M output but writes 3x more tokens to answer the same question is more expensive than a $5/M model that answers tersely. When you compare two models, compare cost-per-completed-task on your own prompts, not cost-per-token on the pricing page. The quantization trap is next: "DeepSeek V4 on host A is half the price of host B" often means host A serves a more aggressive quantization, so you are not comparing the same model at all.

Worked Example: One 1M-Token Agent Task

Take a single agent task that reads a codebase, reasons over it, and writes changes: 1,000,000 input tokens (files, tool outputs, growing history re-sent each turn) and 200,000 output tokens (edits and reasoning). No caching, no routing, one model start to finish. Here is what that one task costs across the field.

Cost of one 1M-in / 200K-out agent task (July 2026)
Model / HostInput costOutput costTotal
Claude Opus 4.8$5.00$5.00$10.00
GPT-5.6 (sol)$5.00$6.00$11.00
Grok 4.5 (<200K per req)$2.00$1.20$3.20
Gemini 3.1 Pro (≤200K per req)$2.00$2.40$4.40
GLM-5.2 (Morph)$1.10$0.82$1.92
Qwen 3.5 397B (Morph)$0.50$0.70$1.20
DeepSeek V4 Flash (Morph)$0.139$0.056$0.20

The spread is 55x from top to bottom for the same nominal task: $11.00 on GPT-5.6, $0.20 on DeepSeek V4 Flash. That gap is real when the cheaper model is capable enough for the work. It collapses when it is not: if the cheap model needs three passes where the frontier model needs one, the effective cost triples and the gap narrows to roughly 18x. The right move is rarely "always use the cheapest." It is to send the easy turns of the task to the cheap model and the hard turns to the capable one, which is what routing does.

Caching and routing change these numbers

This table is the un-optimized worst case: one model, no cache, full context re-sent every turn. In practice, caching the system prompt and stable context cuts input cost 60-90% on the repeated portion, and routing the routine turns to a cheaper tier cuts the blended rate 40-70%. Applied together, a task that costs $10 on Opus 4.8 alone typically lands at $1.50-$3.00. See LLM cost optimization for the full five-lever breakdown.

How to Cut the Bill Without Losing Quality

The pricing table decides your ceiling. Four techniques decide how far below it you actually land, and none of them change what the agent produces.

40-70%
Savings from routing easy turns to a cheaper model
50-70%
Token reduction from compacting context before each call
~90%
Cache-read discount on repeated prefixes (Anthropic, OpenAI)
50%
Batch API discount for non-interactive work

Route. Most turns in an agent loop are routine (formatting, simple edits, lookups). Send those to a cheap model and reserve the frontier model for the hard turns. Since 60-80% of turns are routine, the blended cost drops 40-70%. See the LLM router.

Compact. Agent context grows every turn and is re-sent in full on the next call. Compacting it 50-70% by verbatim deletion cuts input cost proportionally, and keeps you under the 200K long-context threshold where Gemini and Grok double their rates. See Morph Compact.

Cache and batch. Cache the system prompt and stable context for a ~90% read discount on repeated content. For any work a human is not waiting on (evals, pipelines, backfills), use the Batch API for a flat 50% discount that stacks with caching.

Frequently Asked Questions

What is the cheapest LLM API in 2026?

For a general-purpose model that runs a real agent loop, DeepSeek V4 Flash is the cheapest credible option: $0.139 input / $0.278 output per million tokens on Morph, with a 1M-token context window. Among open-model hosts, DeepInfra lists it at $0.09/$0.18. Tiny models like Llama 3.1 8B go lower ($0.02/$0.03 on DeepInfra) but are not frontier-capable.

How much does the Claude API cost per token?

As of July 2026, Claude Opus 4.8 is $5 input / $25 output per million tokens (cache read $0.50) on a 1M window. Sonnet 5 is $3/$15 ($2/$10 introductory through Aug 31, 2026). Haiku 4.5 is $1/$5. Full breakdown: Anthropic API pricing.

How much does the GPT-5 API cost?

OpenAI's July 2026 flagship family is GPT-5.6. gpt-5.6-sol is $5/$30 per million tokens (cached input $0.50); GPT-5.5 is still listed at $5/$30; the cheap tier is gpt-5.4-mini at $0.75/$4.50. Details: OpenAI API pricing.

Does Gemini charge more for long context?

Yes. Gemini 3.1 Pro is $2/$12 per million tokens at or below 200K, and $4/$18 above 200K, with the high rate applied to every token in the request. xAI's Grok 4.5 tiers the same way. Claude and OpenAI do not tier long context on their current models. See Gemini API pricing.

Per-token or per-GPU-minute: which is cheaper?

Per-token wins for bursty or low-volume traffic (no idle cost). Per-GPU-minute (a dedicated H100 at ~$2.20-$7/hour, B200 at ~$3.69-$10/hour) wins once you saturate a GPU most hours of the day. The break-even is utilization: a full-time H100 at $2.20/hour is about $1,584/month, so if your per-token bill for the same throughput exceeds that, move to dedicated.

Why do two hosts charge different prices for the same open model?

Quantization (FP8 vs FP4 changes cost and quality for the same model name), hardware and utilization, and business model. The same DeepSeek V4 Pro SKU is $1.30/$2.60 on DeepInfra and $1.74/$3.48 on Fireworks, Together, and Baseten. Compare cost per completed task on your own prompts, not the sticker rate.

Which LLM APIs offer batch discounts?

Anthropic, OpenAI, Google, Together, Fireworks, Groq, and Novita all offer a 50% Batch API discount with a 24-hour SLA. Batch stacks with caching: an Anthropic batch request hitting a cached prefix can save about 95% on the repeated content. Use batch for evals, pipelines, and background jobs, not interactive agents.

How do I cut my LLM API bill?

Route easy turns to a cheaper model (40-70% off blended cost), compact context before each call (50-70% fewer input tokens), cache repeated prefixes (~90% off on Anthropic/OpenAI), and batch non-interactive work (50% off). Applied together, a task that costs $10 on a frontier model alone typically lands at $1.50-$3.00. Full guide: LLM cost optimization.

Related Pricing Pages

Private deployments

The fastest endpoints are private deployments

Morph's top speeds come from dedicated deployments, not shared public endpoints: speculators trained on your traffic, caching tuned to your workload, and volume discounts over public per-token rates. Over 100 billion tokens per day run this way.

Talk to us about a private deployment

Run the cheapest capable model for each turn

Morph serves DeepSeek V4 Flash at $0.139/$0.278 and GLM-5.2 at $1.10/$4.10 through one OpenAI-compatible API, with routing to send easy turns cheap and hard turns to a frontier model, and Compact to keep context under the long-context tier. One integration, one bill.