LLM API Pricing Comparison Table (Updated Monthly)
LLM API pricing is charged per million tokens, split into input and output rates that usually differ by 4-5x. Anthropic's Claude Haiku 4.5 starts at $1/MTok input and $5/MTok output, Gemini 3.5 Flash-Lite runs $0.30 in and $2.50 out, and DeepSeek's v4-flash goes as low as $0.22/MTok input off-peak, so the cheapest option depends heavily on which model tier and discount mechanics you actually use.
| Tool | Entry plan | Paid from | Notes | Verified |
|---|---|---|---|---|
| Anthropic API | — | $1/MTok input (Claude Haiku 4.5) | Output $5 per MTok; cache hits $0.10 per MTok; batch $0.50 in / $2.50 out | 2026-08-28 |
| Google Gemini API | Free — Free tier | $0.3/MTok input (Gemini 3.5 Flash-Lite) | Output $2.50 per MTok | 2026-08-28 |
| OpenRouter | Free — Inference | — | OpenRouter passes through provider pricing without markup on API usage | 2026-08-28 |
| DeepSeek | — | $0.44/MTok input (cache miss, peak) (deepseek-v4-flash) | Off-peak $0.22 per MTok. Cache hit $0.014 peak / $0.007 off-peak. Output $1.32 peak / $0.66 off-peak | 2026-08-28 |
Pricing verified: 2026-08-28 — fromAnthropic APIGoogle Gemini APIOpenRouterDeepSeek
The short definition
LLM API pricing is quoted per million tokens (MTok), split into separate input and output rates, with output almost always priced several times higher than input. On Anthropic's API, that ratio is exactly 5x across every model: Claude Opus 5 is $5/MTok input and $25/MTok output, Claude Sonnet 5 is $2 in and $10 out, and Claude Haiku 4.5 is $1 in and $5 out. Gemini and DeepSeek follow the same input-cheaper-than-output pattern, just at different absolute rates and with different discount mechanics layered on top.
How it actually works
The baseline comparison across providers looks straightforward until you account for caching, batching, and time-of-day pricing, all of which change the effective rate substantially.
| Provider | Cheapest input rate | Cheapest output rate | Discount mechanism |
|---|---|---|---|
| Anthropic API | $1/MTok (Haiku 4.5) | $5/MTok (Haiku 4.5) | Cache hits at 0.1x input; Batch API halves both, and stacks with caching |
| Gemini API | $0.30/MTok (3.5 Flash-Lite) | $2.50/MTok (3.5 Flash-Lite) | Free tier on certain models via Google AI Studio |
| DeepSeek | $0.22/MTok off-peak (v4-flash) | $0.66/MTok off-peak (v4-flash) | Off-peak rate is half of peak; cache hits ~30x cheaper than misses |
| OpenRouter | Pass-through, no markup | Pass-through, no markup | No markup on inference; cost is in the 5.5% Stripe fee to buy credits |
Anthropic's caching model charges cache reads at 0.1x the base input price — a cache hit on any model costs 10% of standard input — while a 5-minute cache write costs 1.25x base input and a 1-hour write costs 2x. The Batch API separately gives a 50% discount on both input and output for asynchronous work, and that discount stacks with caching, so a batched, cached request on Claude Sonnet 5 can end up far below the $2/$10 sticker rate.
DeepSeek's discount structure runs on the clock instead of on reuse: peak hours are 01:00-04:00 and 06:00-10:00 UTC, Monday through Friday, and off-peak rates are exactly half of peak across every model. Cache hits compound with that — a cache hit on deepseek-v4-flash costs $0.014/MTok at peak and $0.007/MTok off-peak, roughly 30x cheaper than a cache miss. Gemini's pricing takes a third shape entirely: Gemini 2.5 Pro's rate splits depending on whether the prompt is under or over 200k tokens, and some model prices vary further by input type across text, image, video, and audio.
OpenRouter doesn't set its own inference price at all — it passes through whatever the underlying provider charges, with no markup. The cost you actually pay OpenRouter is on getting money into the account: a 5.5% fee with a $0.80 minimum via Stripe, or a 5% fee via cryptocurrency through Coinbase. Bring-your-own-key usage is free up to $25,000/month before a 5% fee applies, rising to a $200,000/month allowance on the enterprise tier.
When you need it — and when you do not
A careful pricing comparison matters most when your workload has real volume — thousands of requests a day where a 2-3x difference in per-token rate compounds into a meaningfully different bill. For prototyping or a handful of daily requests, the sticker price barely matters; what matters more is whether a free tier exists at all. Gemini's free tier is the most usable one here, with free input and output tokens on certain models through Google AI Studio, though that comes with the tradeoff that free-tier content is used to improve Google's products, which rules it out for anything confidential. OpenRouter's free models are rate-limited to 50 requests a day, rising to 1,000 once you've purchased at least $10 in credits.
Once you're past prototyping, the decision usually isn't "cheapest provider" in isolation — it's which discount mechanic matches your actual traffic pattern. A workload that resends the same large context repeatedly benefits most from caching, which favors Anthropic's 0.1x cache-hit price or DeepSeek's even cheaper cache hits. A workload that can tolerate being run asynchronously benefits from Anthropic's Batch API, which halves cost outright and stacks with caching. A workload that can be scheduled benefits from DeepSeek's off-peak window. If none of those apply and you just want the lowest possible flat rate with no strings, DeepSeek's peak-hour pricing and Gemini's Flash-Lite tier are the two cheapest flat rates in this comparison.
The tools that do this
Anthropic, Gemini, DeepSeek, and OpenRouter each solve the pricing question differently, and none of them is unconditionally cheapest across every use case. Anthropic's strength is discount stacking — caching and batching compound, and the full 1M token context window on Claude 4.6 and later is billed at standard pricing with no long-context surcharge. Its weakness is the lack of a permanent free tier, only a small credit grant for new accounts, so testing at any real scale means paying from day one. For a direct provider comparison, see Claude API vs OpenAI API.
Gemini is the only provider here with a free tier you can actually build against rather than a one-time credit, which makes it the natural starting point for a side project or MVP — see Gemini API vs OpenAI API for how it stacks up against another major provider. DeepSeek is the rate leader for cost-sensitive production workloads that can schedule around its UTC peak window, and OpenRouter is the right choice when you want one bill and one API key across many providers rather than the single lowest rate. For workload-specific guidance, best LLM API for coding tasks and cheapest LLM API in 2026 go deeper on both angles.
Frequently asked questions
Which LLM API is cheapest?
On raw per-token rate, DeepSeek's v4-flash is the cheapest in this comparison at $0.22/MTok input off-peak and $0.66/MTok output, with cache hits as low as $0.007/MTok. Gemini's Flash-Lite tier is close behind at $0.30/MTok input, and it has a genuine free tier for testing.
Is there a free LLM API to build with?
Gemini has a real free tier with free input and output tokens on certain models through Google AI Studio, though content is used to improve Google's products. OpenRouter also offers free models rate-limited to 50 requests per day, rising to 1,000 after a $10 credit purchase.
Does OpenRouter charge more than going direct to a provider?
OpenRouter passes through inference at provider pricing with no markup, so the token rate itself is the same as going direct. The added cost is on funding the account — a 5.5% fee with an $0.80 minimum via Stripe, or 5% via crypto through Coinbase.
Why is output pricing so much higher than input pricing?
Every provider in this comparison charges more for output tokens than input tokens — Anthropic's ratio is 5x on every model, and Gemini and DeepSeek follow a similar pattern. Generation is more compute-intensive than reading a prompt, so output-heavy workloads like long-form writing cost disproportionately more than retrieval or classification tasks.