The Cheapest LLM API in 2026: Verified Prices & Best Picks

Last Updated: 2026-07-30 10:09:50

The cheapest LLM APIs in July 2026 cost less than a tenth of a cent per million input tokens. Groq's Llama 3.1 8B Instant lists at $0.05 per million input tokens and $0.08 per million output, confirmed on the provider's own pricing page this month.

That headline number is not what you pay. Prompt caching cuts DeepSeek's effective input price by 50–120×, and batch APIs take another 50% off across Gemini, Mistral, and Groq. Compare list prices and you'll either overpay or pick the wrong provider for your workload. Below is what the cheap options cost, each figure checked against the provider's pricing page on July 30, 2026, and which one wins for what.

The cheapest LLM APIs right now (prices verified July 2026)

The cheapest LLM APIs are small or efficiency-tuned models served by inference specialists, not the frontier labs' flagship endpoints. Prices are standard on-demand pay-as-you-go across major direct providers; the free-tier column flags a free option where one exists. This set excludes self-hosting and temporary promotions.

Model (provider)Input / 1MOutput / 1MCache-hit inputFree tierCheapest for
Llama 3.1 8B Instant (Groq)$0.05$0.08$0.025YesLowest standard price
GPT-OSS 20B (Groq)$0.075$0.30$0.0375YesCheap, 1000 tok/s
Gemini 2.5 Flash-Lite (Google)$0.10$0.40YesCheapest on batch ($0.05 in)
Ministral 3B (Mistral)$0.10$0.10Leanstral (limited)Flat micro pricing
DeepSeek V4 Flash (DeepSeek)$0.14$0.28$0.0028NoCheapest for reasoning
Mistral Small 4 (Mistral)$0.15$0.60−90%NoBalanced general use
Gemini 3.5 Flash-Lite (Google)$0.30$2.50YesMultimodal at scale
Cheapest LLM APIs: input vs output price per million tokens, standard on-demand, verified July 2026

The floor is Groq Llama 3.1 8B at $0.05/$0.08; no other model in this table matches that output price. Gemini 2.5 Flash-Lite hits $0.05 input only on its separate batch tier ($0.10 standard). DeepSeek V4 Flash is the reasoning-oriented pick at the low end.

Why these cost less than GPT or Claude

Low prices come from three places: small or efficiency-tuned models (Llama 3.1 8B, Ministral 3B, the Flash-Lite line), inference specialists running cheaper infrastructure (Groq, DeepSeek), and discounted batch and cached-token rates. Most rows here are open-weight models (Llama, DeepSeek, Mistral); Gemini Flash-Lite is Google's own proprietary line, priced low to compete for volume. Self-hosting open weights can beat these prices at very high, steady volume, but only after you absorb the hardware and ops cost, so for most teams the hosted APIs stay the baseline.

Free tier — the real floor

If "cheapest" means free, several providers here ship a free option: Groq and Google's Gemini Flash-Lite families are free within rate limits, Mistral runs Leanstral free for a limited period, and GitHub Models offers free access with a token. Google's free tier feeds requests into product training (paid does not). Across all of them the rate limits are tight and there is no SLA. We pulled the free options into a separate breakdown at our free AI API guide; for anything past prototyping, the paid rows above are what matter.

The price-per-token trap: caching and batch cut your real bill

Sorted by list input price, a pricing table hides more than it shows. Three levers move the effective price by orders of magnitude, and most omit or bury all of them.

"The great deception of low prices in LLM APIs." — a r/LocalLLaMA thread on how a model's headline price hid a bill dominated by cache-read charges.

Providers charge separately for cached input, fresh input, and output, and the cheap-looking input line is often the smallest part of the invoice. The three levers to compare on:

  • Prompt caching. When the provider can reuse a prefix you have sent before, the cached portion drops to a fraction of the input price. DeepSeek charges $0.0028 per million for cached input on V4 Flash versus $0.14 fresh, a 50× discount, and $0.0036 versus $0.435 on V4 Pro, a 120× discount. Groq halves cached input; Mistral takes 90% off. If your prompts share a long system prompt or document prefix and you are not on a caching-aware provider, you pay full freight on every request.
  • Batch API. Google, Mistral, and Groq all offer roughly 50% off for non-real-time jobs processed within a 24-hour to 7-day window. Gemini 2.5 Flash-Lite's batch tier drops input to $0.05. Anything that doesn't need a sub-second response, overnight summarization, bulk classification, dataset labeling, should go through batch.
  • Output-heavy workloads. Code generation, long-form writing, and agentic loops emit far more tokens than they read. Llama 3.1 8B's $0.08 output beats Gemini 2.5 Flash-Lite's $0.40 on those jobs despite a similar input cost. Sort by output price, not input, when generation is the bottleneck.

The screening checklist: before picking a provider on list price, ask whether your prompts cache well, whether the job is real-time, and whether you emit more than you read. Those three answers reorder the table above more often than the headline numbers do.

Cheapest pick by use case

These picks assume you need a capability floor above the smallest models; raw price alone would put Llama 3.1 8B on every row. They weight real cost, with caching and batch where they apply, against that floor.

Use caseCheapest pickWhy
General chat / classificationMistral Small 4Mid-size general-purpose model above the 3B/8B floor; $0.15/$0.60
Coding & agentic loopsGroq GPT-OSS 20B or Llama 3.1 8BSub-$0.08 output, 840–1000 tok/s keeps loops fast
Reasoning / hard promptsDeepSeek V4 Flash$0.14/$0.28, reasoning-tuned; caches aggressively
Long-context documentsGemini 3.5 Flash-LiteLarge context window, free tier to test
Real-time / latency-boundGroq (any model)Cheap provider that also leads on throughput, 840–1000 tok/s
Bulk / overnight jobsGemini 2.5 Flash-Lite (batch)$0.05 batch input, 50% off for async

Aggregator vs going direct: when a reseller is actually cheaper

Going direct to DeepSeek, Google, Groq, or Mistral gives you the lowest per-token price on a given model. The cost you pay instead is operational: separate API keys, separate billing, manual failover when one provider rate-limits you, and reimplementing caching and retry logic against four different SDKs.

That gap is what aggregators sell. OpenRouter charges the underlying provider's price plus a 5.5% platform fee with no additional markup, and gives you one key, one bill, and automatic failover across the models on this list. OpenRouter's own writeup puts the crossover around $50/month: below that, the 5.5% fee costs less than the engineering time to wire up multiple providers; above it, going direct to the single cheapest provider usually wins on raw cost. Your real break-even depends on how many providers you'd otherwise integrate and how volatile your traffic is.

An aggregator exposes many models behind one OpenAI-compatible endpoint

The same trade applies to a reseller gateway like AIReiter: one OpenAI-compatible endpoint in front of DeepSeek, Gemini, Groq, and Mistral, so you swap models by changing a model name rather than rewriting a client.

FAQ

What is the cheapest LLM API?

Groq's Llama 3.1 8B Instant at $0.05/$0.08 per million tokens is the lowest standard on-demand rate in this comparison as of July 2026. Gemini 2.5 Flash-Lite matches the $0.05 input only on its batch tier ($0.10 standard).

What's the cheapest LLM API for coding?

Groq's GPT-OSS 20B ($0.075/$0.30) or Llama 3.1 8B ($0.05/$0.08) win on output price and speed for code generation and agentic loops. Mistral's Devstral Small 2 at $0.10/$0.30 is the cheap pick if you need a coding-tuned model outside Groq.

Is a free LLM API tier enough for production?

Usually not. Free tiers from Groq, Gemini Flash-Lite, and GitHub Models cap requests per minute and carry no uptime guarantee. They are fine for prototyping. Past early testing, move to the paid rows in the table above.

Are aggregator or reseller APIs more expensive than going direct?

Per token, yes, slightly. OpenRouter adds a 5.5% fee on top of the provider price; reseller gateways bundle similar overhead. They are cheaper in total when your spend is low or you would otherwise maintain several provider integrations, and more expensive once the fee outweighs the convenience.

How much does the cheapest LLM API cost per month?

For 10 million input and 5 million output tokens a month, Groq Llama 3.1 8B costs about $0.90 ($0.50 input + $0.40 output). Gemini 2.5 Flash-Lite runs about $3.00 at standard rates or $1.50 on batch. The same volume on a frontier proprietary model ($5+/M input) is many times more.

What to pick

Turn on prompt caching wherever the provider supports it, and route non-real-time work through batch. Those two switches save more than switching providers ever will.