Model Comparison
Cheapest AI APIs
Per-million-token cost comparison across providers, with notes on where the cheap models are actually good enough.
Verdict
Gemini Flash for general work. DeepSeek for power. Groq for speed. Pick by job, not by brand.
At a glance
| Dimension | Gemini Flash | GPT-5 mini | Claude Haiku | DeepSeek | Groq |
|---|---|---|---|---|---|
Input ($/1M tokens) | $0.15 | $0.40 | $0.80 | $0.27 | — |
Output ($/1M tokens) | $0.60 | $1.60 | $4.00 | $1.10 | — |
Latency (first token) | ~400ms | ~600ms | ~400ms | ~700ms | — |
Throughput (tokens/sec) | Fast | Fast | Fast | Medium | — |
Prompt caching | Yes | Yes | Yes | Yes | — |
Best pick by use case
| If you're doing… | Pick | Why |
|---|---|---|
| Classification / routing | Gemini Flash | Cheapest, accurate enough. |
| Real-time UI streaming | Groq | Lowest latency on the market. |
| Coding at low cost | DeepSeek V3 | Best quality-per-dollar on code. |
| Cheap structured extraction | Gemini Flash or GPT-5 nano | Reliable JSON output at minimum cost. |
| Open-weights / self-host | DeepSeek or Qwen via Ollama | $0 inference if you have hardware. |
The 2026 price floor
| Model | Input ($/1M) | Output ($/1M) | Notes |
|---|---|---|---|
| Gemini 2.5 Flash | 0.15 | 0.60 | Big context, strong all-around |
| GPT-5 nano | 0.10 | 0.40 | Cheapest OpenAI option |
| GPT-5 mini | 0.40 | 1.60 | Solid mid-tier |
| Claude Haiku 4.x | 0.80 | 4.00 | Higher quality, higher price |
| DeepSeek V3 | 0.27 | 1.10 | Open weights also free to self-host |
| Qwen3-Turbo | 0.20 | 0.80 | Solid, especially for code |
| Groq (Llama 3.x 70B) | 0.59 | 0.79 | Best for speed-critical apps |
| Cerebras (Llama 3.x) | 0.60 | 0.80 | Fastest tokens/sec on the market |
Prices change every quarter. Always check provider pricing pages before benchmarking.
What "cheap enough" buys you
Cheap models are great for:
- Classification (is this spam? what category? sentiment?)
- Extraction (pull dates / amounts / names from text)
- Summarization of short documents
- Routing (which downstream model should handle this?)
- Reformatting (CSV → JSON, prose → bullets)
Cheap models are not great for:
- Reasoning chains with multiple steps
- Long-form writing with voice
- Code agent loops
- Tasks where being wrong is expensive
The two-model pattern
The most cost-effective production setup in 2026:
Cheap model → Classify / extract / route
Strong model → Hand off the hard parts only
A spam filter using GPT-5 nano costs 1/50th of the same filter on Claude Sonnet and is within a few % on accuracy.
Hidden costs to watch
- Prompt caching — Anthropic, OpenAI, Gemini all support it. Use it. Reduces input costs by 75–90%.
- Batch APIs — 50% discount for non-realtime work.
- Context bloat — every retained turn in a long conversation costs tokens. Trim aggressively.
The reality
API prices have fallen ~10x in 18 months. They will fall further. If your product is gated by today's API costs, plan for what 3x cheaper looks like — that's where you'll be in 12 months.
Frequently asked questions
Related on AIKnowHub
Comparison
Best AI Model for Coding
Which model actually writes the best code? Benchmarked against real tasks — refactors, bug fixes, new features, code review.
Comparison
Best Free AI Tools
The AI tools that are genuinely useful at $0 — no trial, no credit card, no rage-quit moments.
Comparison
GPT vs Claude vs Gemini
An honest head-to-head of the three frontier models — where each one wins, where each one loses, and what to pick.
Workflow
Build an AI Research Assistant
A research agent that takes a question, searches the web, reads sources, and produces a cited briefing.
Concept
LLM Cost Optimization
The operational playbook for cutting LLM spend without cutting quality. Model routing, caching, batching, and the metrics that actually matter.
Tool Guide
LiteLLM Guide
The definitive guide to LiteLLM for multi-model routing — OpenAI-compatible proxy, fallbacks, cost tracking, and self-host setup for production AI apps.