Skip to content
TheAgent Ecosystem
Models & Cost

Cheapest AI API in 2026: DeepSeek vs Claude vs GPT vs Gemini

A dated, source-linked price table, plus the math that turns a token rate into a real bill.

Muhammad Qasim HammadAI-assisted9 min read1,835 words

AI-drafted, reviewed by Muhammad Qasim Hammad on July 1, 2026. See our AI disclosure.

LLM Pricing: The Cheapest AI API, Priced Honestly
Table of contents
  1. What is the cheapest AI API in June 2026?
  2. The dated price table: DeepSeek vs Gemini vs GPT vs Claude
  3. Price per task beats price per token
  4. The cheap-but-watch-out list (what the roundups skip)
  5. Which API is cheapest for your job?

Every "cheapest AI API" roundup is wrong within a month. Providers reprice, models get deprecated, and the page you are reading still quotes a model that was retired in the spring. So this is built differently: a dated, source-linked price table from the four providers' own pages, plus the math to turn a token rate into a real bill. The cheapest AI API by published token rate in June 2026 is DeepSeek V4 Flash, but the lowest sticker rate is not always the lowest bill.

The trap in every cheap roundup is comparing the input rate and stopping there. Your bill is mostly output tokens, retries, and rate-limit waits, none of which show up in a headline "from $0.10 per million." This guide compares on three numbers instead: input rate, output rate, and cost per realistic task.

What is the cheapest AI API in June 2026?#

By published token rate in June 2026, the cheapest AI API among the big four is DeepSeek V4 Flash at $0.14 input and $0.28 output per million tokens. Gemini 2.5 Flash-Lite undercuts it on input at $0.10, but charges more on output at $0.40, so the winner depends on your traffic.

That single comparison already shows the problem with "cheapest." DeepSeek wins on output, Gemini wins on input, and which one wins your bill depends entirely on your output-to-input ratio. There is no context-free answer.

So fix the rule for the whole post. Compare every option on three numbers: input dollars per million tokens, output dollars per million tokens, and the cost of one realistic task. Never rank on the input rate alone, because the input rate is the cheapest-looking half of the bill and almost never the biggest.

Three cards: a 0.14 dollar input floor, a 0.28 dollar output floor, and a 50 percent batch discountOutput tokens usually dominate, so the output rate matters more than the headline input rate. Source: provider pricing pages.

Output is the expensive half on every provider, often four to six times the input rate. Keep that in mind for everything below: the headline number sells the input rate, but the output rate is what scales with your usage.

The dated price table: DeepSeek vs Gemini vs GPT vs Claude#

Here are the cheapest live model and the flagship from each provider, by published rate as of June 2026. Read it as a price ranking only, not a quality ranking: these models are not interchangeable. Click each provider's pricing page before you commit, because these numbers move and models get deprecated.

Table of June 2026 LLM API prices per million tokens for DeepSeek, Gemini, OpenAI, and ClaudePublished rates as of June 2026. Click each provider's pricing page before you trust this; these numbers move.

A few notes that the raw table cannot show:

  • DeepSeek. V4 Flash is $0.14 / $0.28 and V4 Pro is $0.435 / $0.87, both with a 1M-token context. The legacy deepseek-chat and deepseek-reasoner aliases are deprecating on 2026-07-24 and currently map to V4 Flash, so pin explicit model IDs now.
  • Gemini. 2.5 Flash-Lite ($0.10 / $0.40) is the cheapest live Gemini; 3.1 Flash-Lite ($0.25 / $1.50) is the current-generation budget model. Watch the tier trap on the Pro models: above 200K input tokens, the rate roughly doubles.
  • OpenAI. GPT-5.4-nano ($0.20 / $1.25) is the cheapest, GPT-5.4-mini is $0.75 / $4.50, and the GPT-5.5 flagship is $5 / $30.
  • Claude. Haiku 4.5 ($1 / $5) is the cheapest, Sonnet 4.6 is $3 / $15, and Opus 4.8 is $5 / $25 with the full 1M context available at standard price.

Context size is a cost lever too, not just a capability. DeepSeek V4 and the Gemini models carry a 1M-token window, so you can drop a long document straight into the prompt instead of building retrieval around it. That convenience is billed as input tokens, though, so a 1M-context model is only cheap if you actually keep the prompt small. The window is a ceiling, not a discount.

The honest framing: these "cheapest" models are not the same tool at different prices. A nano or lite model is a smaller model, so this table ranks price, and price only.

Price per task beats price per token#

The token rate is the sticker price; the bill is the cost per task, and output tokens usually dominate it. A model with a low input rate but a high output rate can still lose. Compare the same realistic job across models, and watch the output rate do most of the damage.

Bar chart of modeled cost in cents per summarize task across five cheap LLM modelsModeled: cents = 2000/1e6 x input + 500/1e6 x output, x100. A low input rate with a high output rate is not the cheapest per task.

Take one concrete task: summarize a 2,000-token document into a 500-token summary. The per-task cost is (input_tokens / 1,000,000 × input_rate) + (output_tokens / 1,000,000 × output_rate). For GPT-5.4-nano that is 2000/1e6 × $0.20 + 500/1e6 × $1.25 = $0.0004 + $0.000625, about $0.001, or a tenth of a cent. Here is the same job across the cheap tier:

ModelInput /MTokOutput /MTokCost per task (2K in + 500 out)
Gemini 2.5 Flash-Lite$0.10$0.40~$0.00040 (0.04c)
DeepSeek V4 Flash$0.14$0.28~$0.00042 (0.042c)
GPT-5.4-nano$0.20$1.25~$0.0010 (0.10c)
Gemini 3.1 Flash-Lite$0.25$1.50~$0.00125 (0.13c)
Claude Haiku 4.5$1.00$5.00~$0.0045 (0.45c)

The reveal is in the last column. Gemini 2.5 Flash-Lite and DeepSeek V4 Flash tie near the bottom because their output rates are low, while Haiku 4.5 costs roughly ten times more per task despite being the "cheap" Claude. The ranking by task is not the ranking by input rate.

Flip the task and the ranking flips with it. A classification job that sends 4,000 tokens of context and returns a 20-token label is almost all input, so the input rate and any caching dominate, and Gemini 2.5 Flash-Lite at $0.10 input edges ahead of DeepSeek. Same two models, opposite winner, decided entirely by the shape of the work.

So match the model to the shape of your work. For long generations such as drafts, code, or reports, output dominates, so favour the lowest output rate (DeepSeek V4 Flash). For retrieval or classification where you send a lot and get back a little, the input rate and caching matter most, so favour Gemini Flash-Lite or DeepSeek with its automatic disk cache. To sanity-check any of this before you build, the Claude API cost-control guide walks through estimating a bill up front.

The cheap-but-watch-out list (what the roundups skip)#

The cheapest rate hides fine print that the roundups skip. Output blowups, deprecating model aliases, free tiers that get clawed back, smaller models that trade away quality, and rate limits that throttle bursts can all erase the saving. Here is what to check before you wire a cheap model into production.

Pros and cons of choosing the cheapest LLM API by token price aloneThe sticker price is the input rate; the bill is mostly output tokens, retries, and rate-limit waits.

The watch-outs in order of how often they bite:

  • Output blowup. A runaway agent or a "write the whole thing" prompt multiplies the expensive half of the bill. Cap max_tokens on every call.
  • Deprecation. Cheap aliases get retired; deepseek-chat and deepseek-reasoner end on 2026-07-24. Pin explicit model IDs and watch the changelogs.
  • Free-tier clawback. Gemini's free Flash quota was cut hard, to roughly 20 requests per day around December 2025. Free is a sandbox, not a plan; check current limits in AI Studio.
  • Quality versus size. The cheapest model is the smallest model. Validate it on your own task first, because a wrong answer you have to redo is not cheap.
  • Rate limits. Budget tiers throttle bursts. For non-urgent volume, the Batch API on OpenAI, Gemini, and Claude is 50% off at roughly 24-hour turnaround.

None of these are reasons to avoid the cheap models; they are reasons to pin versions, cap tokens, and test before you scale. The saving is real when the cheap model clears your quality bar and you control the output side. It evaporates when a retry storm, a deprecated alias, or a clawed-back free tier quietly turns a tenth-of-a-cent task into a support ticket.

Which API is cheapest for your job?#

There is no single winner, only the cheapest fit for your job. Hard reasoning or agents lean to a flagship if you need top quality, or DeepSeek V4 Pro if you do not. Simple high-volume work wants the lowest output rate for long generations, or the lowest input rate plus caching for retrieval.

Decision flowchart for choosing the cheapest LLM API by task type, quality need, and output-versus-input balancePick the cheapest fit for the job, then stack caching and the Batch API to cut 50 to 90 percent more.

Once you have picked a model, stack the two discounts everyone can use on top of it. Prompt caching bills repeat input at roughly a tenth of the base rate, and the prompt-caching playbook shows the setup; DeepSeek does this automatically on disk. The Batch API takes another 50% off both input and output for non-urgent jobs. Together they cut 50 to 90% off whichever model you chose.

Two quick scenarios make it concrete. A high-volume support classifier that reads tickets and returns short tags is input-heavy and quality-tolerant, so Gemini 2.5 Flash-Lite or DeepSeek V4 Flash with caching is the floor. A coding agent that writes long diffs and reasons across steps is output-heavy and quality-sensitive, so DeepSeek V4 Pro or a flagship earns its rate, and capping max_tokens keeps the output side honest.

And remember the option that beats all four on the right workload: a local model. When you run the same prompt thousands of times a day, self-hosting can undercut every API rate, and Ollama versus LM Studio versus Jan covers the local runners. If you want a quality read alongside price, Claude vs GPT vs Gemini tested in n8n compares the providers on real agent tasks. Pick on price where the models are close on quality, and pay up only where the harder model genuinely earns it.

Frequently asked questions

What is the single cheapest AI API right now?
By published token rate in June 2026, DeepSeek V4 Flash at $0.14 input and $0.28 output per million tokens. Gemini 2.5 Flash-Lite is cheaper on input ($0.10) but pricier on output ($0.40), so which one wins your bill depends on your output-to-input ratio.
Is DeepSeek really cheaper than GPT and Claude?
On token rate, yes, by a wide margin: GPT-5.4-nano is $0.20/$1.25 and Claude Haiku 4.5 is $1/$5. On a per-task basis the cheap Gemini and DeepSeek models stay near the bottom, while the flagships cost more but are different-quality tools.
Why is the output price so much higher than the input price?
Generation is the expensive half on every provider, often four to six times the input rate. That is why you should compare cost per task, cap max_tokens, and prefer low-output-rate models for long generations like drafts, code, and reports.
How do I cut the bill further without changing model?
Use prompt caching, which bills repeat input at roughly a tenth of the base rate, and the Batch API, which is 50% off at about 24-hour turnaround on OpenAI, Gemini, and Claude. DeepSeek caches on disk automatically, with no code change.
Will these prices still be right next month?
Maybe not. This table is stamped June 2026, and providers reprice and deprecate often; deepseek-chat and deepseek-reasoner retire on 2026-07-24. Click the linked pricing pages before you commit money to any single model.

Sources

Primary references and vendor documentation used while drafting and reviewing this article.

  1. DeepSeek API pricing (V4 Flash/Pro rates, cache hit/miss, 1M context, alias deprecation 2026-07-24)
  2. DeepSeek context caching on disk (automatic, ~10x cheaper on hits)
  3. Google Gemini API pricing (2.5/3.x rates, 200K tiered pricing, batch ~50%)
  4. Google Gemini API rate limits (free-tier volatility, RPD reset)
  5. OpenAI API pricing (GPT-5.4-nano/mini, GPT-5.5 flagship, cached input)
  6. OpenAI Batch API (50% discount, ~24h, 50k/200MB limits)
  7. Anthropic Claude pricing (Haiku 4.5 / Sonnet 4.6 / Opus 4.8, Batch 50%, cache read 0.1x)
  8. Anthropic context windows (200K standard, 1M on Opus 4.6+/Sonnet 4.6)

Written by

Muhammad Qasim Hammad
Muhammad Qasim Hammad
AI agents & automationFounder · Cart Gaze LLCPMP-certified PM

Muhammad Qasim Hammad is an AI agent and automation expert and the founder of Cart Gaze LLC (cartgaze.com). He builds product for the love of it: when an idea lands, a working prototype is usually running within hours, built with the same AI agents and automations he sells. He puts his own output at roughly 20× what it was before agents, and the Agentic OS behind this site is the working proof, documented in public with the tools he actually ran and what they really cost.

AI & Automation Services

Want a pipeline like this running in your business?

I'm Qasim — I design and ship AI agents and n8n automations for solo operators and small teams. Tell me what's eating your team's week, and I'll scope a fix.

Related reading