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.
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.
“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.”
| Model / Host | Input | Output | Context | Note |
|---|---|---|---|---|
| DeepSeek V4 Flash (Morph) | $0.139 | $0.278 | 1M | Frontier-capable, agent-ready |
| DeepSeek V4 Flash (DeepInfra) | $0.09 | $0.18 | 128K | Cheapest listed DeepSeek SKU |
| Qwen 3.6 27B (Morph) | $0.289 | $2.40 | 131K | Small fast coder |
| gpt-oss-120b (DeepInfra) | $0.037 | $0.17 | 131K | Cheapest open flagship |
| Llama 3.1 8B (DeepInfra) | $0.02 | $0.03 | 128K | Not frontier-capable |
| Gemini 3.1 Flash-class | ~$0.30 | ~$2.50 | 1M | Cheapest closed frontier tier |
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.
| Model | Input | Output | Cache read | Context |
|---|---|---|---|---|
| Claude Opus 4.8 | $5.00 | $25.00 | $0.50 | 1M |
| Claude Sonnet 5 | $3.00 | $15.00 | $0.30 | 1M |
| Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | 200K |
| GPT-5.6 (sol) | $5.00 | $30.00 | $0.50 | 400K |
| GPT-5.4 mini | $0.75 | $4.50 | $0.075 | 400K |
| Gemini 3.1 Pro (≤200K) | $2.00 | $12.00 | $0.20 | 1M |
| Gemini 3.1 Pro (>200K) | $4.00 | $18.00 | $0.40 | 1M |
| Grok 4.5 (<200K) | $2.00 | $6.00 | $0.50 | 500K |
| Grok 4.5 (≥200K) | $4.00 | $12.00 | $1.00 | 500K |
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.
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.
| Provider | gpt-oss-120b | DeepSeek V4 (Pro/Flash) | GLM-5.2 | Model |
|---|---|---|---|---|
| DeepInfra | $0.037 / $0.17 | $1.30/$2.60 · $0.09/$0.18 | $0.93 / $3.00 | Cheapest per token |
| Groq | $0.15 / $0.60 | not hosted | not hosted | LPU, ~500 tok/s |
| Fireworks AI | $0.15 / $0.60 | $1.74/$3.48 · $0.14/$0.28 | $1.40 / $4.40 | Broad catalog |
| Together AI | $0.15 / $0.60 | $1.74/$3.48 | $1.40 / $4.40 | Broad catalog |
| Baseten | $0.10 / $0.50 | $1.74/$3.48 | $1.40 / $4.40 | Model APIs + dedicated |
| Novita AI | $0.05 / $0.25 | $1.60/$3.20 · $0.14/$0.28 | $1.40 / $4.40 | Per-token + GPU |
| Cerebras | $0.35 / $0.75 | not hosted | GLM-4.7 $2.25/$2.75 | Wafer-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 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.
| Model | Input | Cached input | Output | Context |
|---|---|---|---|---|
| DeepSeek V4 Flash | $0.139 | — | $0.278 | 1M |
| Qwen 3.6 27B | $0.289 | — | $2.40 | 131K |
| Qwen 3.5 397B | $0.50 | $0.30 | $3.50 | 262K |
| MiniMax M3 428B | $0.60 | — | $2.40 | 256K |
| GLM-5.2 744B | $1.10 | $0.22 | $4.10 | 1M |
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.
| Pricing model | Who uses it | You pay for | Best when |
|---|---|---|---|
| Per token | Claude, GPT, Gemini, Grok, serverless open-model APIs | Input + output tokens, no idle cost | Bursty or low-volume traffic |
| Per GPU-minute / hour | Baseten dedicated, Together/Fireworks/DeepInfra endpoints | Rented GPU time (H100 ~$2.20-$7/hr, B200 ~$3.69-$10/hr) | High sustained utilization |
| Subscription | Cerebras Code ($50-$200/mo) | Flat fee, capped daily tokens | One developer, steady daily coding |
| Credits + fee | OpenRouter | Provider pass-through rate + purchase fee (~5%) | Multi-provider access from one key |
| Serve-only / download | Enterprise online learning | Custom checkpoint, negotiated rate | Self-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.
| Provider | Tiers long context? | Threshold | Multiplier |
|---|---|---|---|
| Google Gemini 3.1 Pro | Yes | 200K tokens | ~2x input and output |
| xAI Grok 4.5 | Yes | 200K tokens | ~2x input and output |
| Anthropic Claude | No | Flat to 1M | 1x |
| OpenAI GPT-5.6 | No | Flat to 400K | 1x |
| Most open-model hosts | No | Flat to model max | 1x |
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.
| Provider | Cache read | Write premium | Mechanism |
|---|---|---|---|
| Anthropic Claude | 0.1x base (~90% off) | 1.25x-2x | Explicit cache_control markers |
| OpenAI GPT | 0.1x base (~90% off) | None | Automatic on 1K+ token prefixes |
| Google Gemini | $0.20-$0.40/M + $4.50/hr storage | None | Automatic + hourly storage fee |
| xAI Grok | $0.50/M ($1.00 above 200K) | None | Automatic |
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.
| Hidden factor | What it does | Who it hits |
|---|---|---|
| Reasoning / verbosity tokens | Reasoning models emit hidden thinking tokens you pay for at the output rate | GPT reasoning tiers, Gemini thinking, any verbose model |
| Quantization differences | FP4 host is cheaper than FP8 host for the same model name, but output quality differs | Open-model hosts serving the same weights |
| Long-context tiering | Rates double above 200K on some providers, on every token | Gemini, Grok on large requests |
| Rate limits forcing higher tiers | Free/low tiers throttle agents, pushing you to a paid tier sooner than the token math implies | Cerebras 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.
| Model / Host | Input cost | Output cost | Total |
|---|---|---|---|
| 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.
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.
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
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.
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.