"Cheapest" depends on what you're actually asking. Cheapest raw list price, cheapest once caching kicks in, or cheapest at $0 because you haven't shipped to production yet — these are three different answers, and most comparisons collapse them into one. This page doesn't: pick the question that matches your workload below.
LeanLM (not affiliated with Google's LearnLM educational AI) is an LLM cost optimization platform. This page is a decision-focused ranking — for the full pricing matrix and the methodology behind every computed cell, see our LLM effective cost table.
Verified July 11, 2026
Every price below was checked against the provider's own pricing page today. OpenAI's cheapest current model is gpt-5.4-nano at $0.20/$1.25 per million tokens — confirmed directly against OpenAI's own pricing page, which lists no separate "GPT-5 nano" model. (Several third-party trackers cite a "GPT-5 nano" at $0.05/$0.40 — that figure doesn't appear on OpenAI's current pricing page and was excluded here rather than repeated on faith.) This matches the figure already verified on our effective cost table.
What Is the Cheapest LLM API? (Short Answer)
- Cheapest raw list price, any provider: DeepSeek v4-flash at $0.14 per million input tokens / $0.28 per million output tokens.
- Cheapest raw list price from a major lab (OpenAI/Google/Anthropic): OpenAI's gpt-5.4-nano at $0.20 per million input tokens / $1.25 per million output tokens.
- Cheapest with caching: DeepSeek v4-flash at $0.0028 per million tokens on cache hits — cheaper than any stacked discount on a major-lab model.
- Cheapest at scale with caching + batch stacked (major labs): gpt-5.4-nano and gemini-3.1-flash-lite both land near $0.01–$0.0125/MTok once cache + batch discounts stack — see the full effective cost table for the exact math.
- Cheapest overall: $0 — Gemini's free tier, Groq, or OpenRouter's free models, if your workload fits inside their rate limits.
The Decision Framework: Cheapest for What?
Real searches for this topic aren't just "what's the cheapest model" — they're "cheapest for coding," "cheapest at scale," "cheapest with caching." Each has a different right answer:
Cheapest for coding
If you're prototyping or running low-volume coding tasks, OpenRouter's free tier includes Qwen3 Coder — a model tuned for code generation — at $0 within its rate limits (20 requests/minute, 50/day, rising after a one-time paid credit). For production coding workloads with real volume, DeepSeek's cached price becomes the cheapest paid option once your prompts share enough context (system prompts, file contents) to hit the cache repeatedly.
Cheapest at high volume
At real production scale, list price stops mattering — effective price (after caching and batch discounts) does. gpt-5.4-nano and gemini-3.1-flash-lite both stack down to roughly $0.01–$0.0125/MTok on cached, batched traffic. Route only the subtasks that need it to a larger model; nano/lite-tier models handle classification, extraction, and formatting at a fraction of the cost.
Cheapest with caching
DeepSeek v4-flash's $0.0028/MTok cache-hit price is the cheapest number on this page, full stop — a 98% discount off its own list price, and cheaper than any stacked discount available on a major-lab model. The catch: this requires a workload with genuinely repeated context (DeepSeek's caching is automatic — no cache_control to manage).
Cheapest raw price, no caching or batching required
DeepSeek v4-flash at $0.14/$0.28 per million tokens — no caching or batch setup required to get this price; it's the plain list rate. If you need a major-lab model specifically (data residency, support SLA, ecosystem), OpenAI's gpt-5.4-nano at $0.20/$1.25 is the cheapest option among OpenAI, Google, and Anthropic.
Early Access
Not Sure Which Model Is Actually Cheapest for You?
LeanLM profiles your production traffic against your real cache-hit rate and task mix, then validates a cheaper model or routing config against your actual quality bar before anything ships. Join the waitlist below.
The Cheapest LLM APIs, Ranked
| Category | Winner | Price | Best for |
|---|---|---|---|
| Cheapest raw list price (any provider) | DeepSeek v4-flash | $0.14 / $0.28 per MTok | Low-volume, no caching setup |
| Cheapest raw list price (major lab) | gpt-5.4-nano (OpenAI) | $0.20 / $1.25 per MTok | Needs OpenAI/Google/Anthropic specifically |
| Cheapest with caching | DeepSeek v4-flash | $0.0028 per MTok (cache hit) | High-repeat-context workloads |
| Cheapest major-lab, cache+batch stacked | gemini-3.1-flash-lite | ~$0.0125 per MTok | Production scale, needs a major lab's ecosystem |
| Cheapest for coding (free) | OpenRouter (Qwen3 Coder) | $0 (rate-limited) | Prototyping, low-volume coding tasks |
| Cheapest overall | Gemini free tier / Groq | $0 (rate-limited) | Prototyping only, not production |
Prices verified July 11, 2026 against provider pricing pages and independent trackers. Stacked/cached figures for gpt-5.4-nano and gemini-3.1-flash-lite reuse the already-verified methodology on our effective cost table rather than re-deriving them here.
Is There a Free LLM API?
Yes — three genuinely usable free tiers as of July 2026, each with real (not marketing-only) limits worth knowing before you build against them:
Google Gemini (AI Studio)
Free access to Gemini's Flash-tier models with no credit card required. Limits are tier-based and change more often than Groq's or OpenRouter's published numbers — check your live rate limits in AI Studio rather than trusting a static figure. Still the most production-adjacent of the three free options — Google's own infrastructure, not a rate-limited proxy layer.
Groq
Free tier with published, predictable rate limits — for example, Llama 3.3 70B at 30 requests/minute and 1,000 requests/day. No credit card required. Known for very low latency inference, which matters if your prototype is latency-sensitive.
OpenRouter
Roughly 28 free models available (DeepSeek R1, Llama 3.3 70B, Qwen3 Coder, Gemma 3, and others) through one unified API. Rate limits start tighter — 20 requests/minute, 50 requests/day — rising to 1,000/day after a one-time paid credit purchase. The advantage: one integration surface across many free models instead of juggling separate provider accounts.
The honest caveat: all three are built for prototyping and low-volume use, not production traffic. Rate limits will throttle you well before you reach meaningful scale — budget for a paid tier once you're validating with real users, not before.
Early Access
From Free Tier to Production, Without Guessing
LeanLM validates whether a cheaper model or a free-tier alternative actually holds your quality bar on production traffic — before you commit budget to scaling it. Join the waitlist.
Where to Go Next
- LLM cost calculator — plug in your own input/output tokens and monthly volume to see these same prices ranked by your actual monthly cost, with cache-hit and batch toggles.
- LLM effective cost table — the full pricing matrix and the exact multiplier methodology behind every stacked-discount figure on this page.
- Best LLM cost tracking tools — including ArtificialAnalysis.ai, the independent benchmark site for comparing models on cost, speed, and quality before you commit to one.
- LLM model routing — automatically send each query to the cheapest model that can handle it, rather than picking one model for everything.
Frequently Asked Questions
What is the cheapest LLM API?
On raw list price, DeepSeek v4-flash is the cheapest at $0.14 per million input tokens and $0.28 per million output tokens, cheaper than any major-lab nano/lite-tier model. Among the major labs (OpenAI, Google, Anthropic), OpenAI's gpt-5.4-nano is cheapest at $0.20/$1.25 per million tokens. On cache-hit pricing, DeepSeek is cheaper still at $0.0028 per million input tokens — a 98% discount off its own $0.14 cache-miss price.
Is there a free LLM API?
Yes. Google's Gemini API (via AI Studio) offers a genuinely free tier with no credit card required on Flash-tier models — limits are tier-based and change often, so check the live numbers in AI Studio rather than a fixed figure. Groq offers a free tier with published rate limits (for example, 30 requests/minute and 1,000 requests/day on Llama 3.3 70B). OpenRouter provides around 28 free models at lower rate limits (20 requests/minute, 50/day, rising after a one-time paid credit). All three are best for prototyping and low-volume use — none are built for production-scale traffic.
Which LLM API is cheapest for coding?
For coding tasks specifically, OpenRouter's free tier includes Qwen3 Coder, a model tuned for code generation, at zero cost within its rate limits. For paid, production-grade coding workloads, DeepSeek's models are frequently used for coding tasks and its effective cached price ($0.0028/MTok) is the cheapest paid option once your prompts repeat enough shared context (system prompts, file context) to benefit from caching.
What is the cheapest LLM API in 2026?
As of July 2026: DeepSeek v4-flash ($0.14/$0.28 per million tokens) is the cheapest raw list price of any provider; among major labs, OpenAI's gpt-5.4-nano ($0.20/$1.25) is cheapest. DeepSeek's cache-hit price ($0.0028/MTok) is the cheapest paid price of any kind, if your workload caches well. For $0 spend, Gemini's free tier (via AI Studio), Groq, and OpenRouter's free models cover prototyping and low-volume production use.