Cheapest LLM API in 2026: Real Cost per 1M Tokens Table
As of October 2026, the cheapest LLM API on sticker price is OpenAI's gpt-5-nano at $0.05 per 1M input tokens and $0.40 per 1M output tokens. Close behind are Groq's hosted gpt-oss-20b ($0.075 / $0.30) and the new small models from OpenAI and Anthropic, GPT-6-Luna and Claude Haiku 5.5 (both $0.10 / $0.50). Once you add prompt caching and batch discounts, the order changes. DeepSeek's deepseek-flash charges only $0.003–$0.006 per 1M cached input tokens, so for workloads that resend the same long context it can cost less than models with a lower list price. If you want $0, Google's Gemini free tier and Groq's free plan cost nothing. They come with tight limits and, in Google's case, your data may be used to improve its products.
Which option is right for you?
Start with the row that matches your situation. You can switch providers later, because most of them accept OpenAI-style requests.
| Your situation | What to pick first | First page to open |
|---|---|---|
| Beginner or student, $0 budget | Gemini free tier (Flash or Flash-Lite). No card needed, but your prompts may be used for training | Gemini API pricing |
| Daily work use, short prompts, high volume | gpt-5-nano or GPT-6-Luna, with Batch for anything that can wait 24h | OpenAI API pricing |
| Long repeated context (RAG, agents, coding) | deepseek-flash during off-peak hours. Its cache-hit price is the lowest listed | DeepSeek pricing |
| Tight budget, need fast open-weight model | Groq gpt-oss-20b ($0.075 / $0.30) | Groq models |
| You want quality plus a predictable bill | Claude Haiku 5.5 with prompt caching and a Console spend limit | Claude pricing |
| Coding agent on a large repo | A mid-tier model with caching (Sonnet 5.5, GPT-6.1-Sol or DeepSeek V4 Pro) | Anthropic prompt caching |
For the five-provider overview with monthly totals, see our LLM API pricing comparison for 2026.
What Is the Cheapest LLM API Right Now?
The cheapest LLM API right now depends on your cache hit rate. Without caching, gpt-5-nano is cheapest. With heavy caching, gpt-5-nano, Groq and the new small models are all within a few dollars of each other, and DeepSeek's cache price makes it the lowest-cost option for very long repeated context.
Every figure below comes from the provider's own pricing page (as of October 2026; check the official page). To compare real cost, the table applies all of them to one example workload: 50M input tokens and 5M output tokens a month, where 80% of the input (40M tokens) is a repeated prefix that can be cached.
| Model (provider) | Input / output per 1M | Cached input per 1M | Example, no caching | Example, 80% cached | Example, cached + batch |
|---|---|---|---|---|---|
gpt-5-nano (OpenAI) | $0.05 / $0.40 | $0.005 | $4.50 | $2.70 | $1.35 |
gpt-oss-20b (Groq) | $0.075 / $0.30 | 50% off input | $5.25 | $3.75 | $2.63 |
| GPT-6-Luna (OpenAI) | $0.10 / $0.50 | $0.01 | $7.50 | $3.90 | $1.95 |
| Claude Haiku 5.5 (Anthropic) | $0.10 / $0.50 | $0.01 (writes $0.125) | $7.50 | $3.90 + writes | ~$1.95 if discounts stack |
deepseek-flash, off-peak | $0.15 / $0.60 | $0.003 | $10.50 | $4.62 | no batch API |
deepseek-flash, peak | $0.30 / $1.20 | $0.006 | $21.00 | $9.24 | no batch API |
| Llama 3.1 8B Instruct Lite (Together) | $0.14 / $0.14 | none listed | $7.70 | $7.70 | not stated |
| Gemini 3.1 Flash-Lite (Google) | $0.25 / $1.50 | $0.0125 | $20.00 | $10.50 | $5.25 |
Sources for the rows: OpenAI pricing, Groq models and Groq prompt caching, Claude pricing, DeepSeek pricing, Together pricing, Gemini pricing. Anthropic lists the Haiku 5.5 rates for prompts of 100K tokens or fewer.
A few things the table shows. Caching does the most for DeepSeek, cutting the example bill by 56%, because its cache-hit price is 2% of its cache-miss price. On models without a cache discount, such as Together's Llama 8B Lite, cost stays flat no matter how repetitive your prompts are. Gemini 3.1 Flash-Lite ranks low on paid price, but it is the one model here with a free tier you can use in production-like volumes.
Common mistakes when reading this table:
- Ranking on input price only. Output usually costs 4–8× more than input. If your app writes long answers, compare output prices first.
- Assuming the old model is the cheap model.
gpt-5-nanois cheaper per token than GPT-6-Luna, but it is an older generation. If it needs two attempts where Luna needs one, you pay more. Test both on 50 of your own prompts before you commit. - Ignoring DeepSeek's peak hours. Off-peak prices are half of peak. DeepSeek defines peak as 01:00–04:00 and 06:00–10:00 UTC, Monday to Friday (DeepSeek pricing). For US-based traffic, most daytime hours fall off-peak.
How Do Prompt Caching and Batch Discounts Change the Real Cost Per 1M Tokens?
Prompt caching bills repeated input at 1–10% of the normal price, and batch APIs take 50% off work that can wait. Together they can cut a bill by more than 70%, so sticker price is a poor guide for budgeting.
Here is what each provider documents (as of October 2026; check the official page):
| Provider | Cache read price | Cache write cost | Minimum prefix | Batch discount |
|---|---|---|---|---|
| OpenAI | 0.1× input (0.05× for GPT-6.1-Sol) | none by default; 12h retention costs more | 1,024 tokens (GPT-5.6+) | 50%, within 24h |
| Anthropic | 0.1× input (0.05× for Opus/Sonnet 5.5) | 1.25× (5 min) or 2× (1 hour) | 512 tokens on 5.5 models | 50% |
| Google Gemini | ~5–10% of input, implicit by default | explicit caches add hourly storage | 4,096 tokens on 3.x Flash | 50% |
| DeepSeek | ~2% of cache-miss price | none listed | prefix units, automatic | none; off-peak 50% instead |
| Groq | 50% off input (GPT-OSS models only) | none | 128–1,024 tokens | 50%, but no extra cache discount |
Sources: OpenAI prompt caching, OpenAI Batch API, Anthropic prompt caching, Claude pricing, Gemini caching, Gemini pricing, DeepSeek context caching, Groq prompt caching.
To calculate your effective cost per 1M tokens:
- Export 30 days of usage from your provider's usage page. Split the tokens into uncached input, cached input, cache writes and output. DeepSeek returns
prompt_cache_hit_tokensandprompt_cache_miss_tokensin every response (DeepSeek caching). Anthropic returnscache_read_input_tokens,cache_creation_input_tokensandinput_tokens(Anthropic rate limits). - Multiply each bucket by its own price: uncached × input price, cached × cache-read price, writes × write price, output × output price.
- Find the share of your traffic that doesn't need an answer within seconds. Examples: nightly classification, evals, summaries. Halve the cost of that share for Batch.
- Divide the total by total tokens to get one blended dollars-per-1M figure. Use that number to compare providers.
Example: an Anthropic app sends a 3,000-token system prompt plus a 200-token question. Only the part after the last cache breakpoint shows up as input_tokens. Anthropic's docs give a more extreme case: a 200K cached document plus a 50-token question reports input_tokens: 50 (Anthropic rate limits). If your cost script only sums input_tokens, it will undercount your bill.
Pitfalls and fixes:
- The cache never hits. Anything that changes the start of the prompt, such as a timestamp, a user ID or a reordered tool list, breaks the prefix. Put stable content first and variable content last.
- Paying for writes that are never read. On Anthropic, a 5-minute cache write costs 1.25× input. If the same prefix isn't reused within 5 minutes, caching costs you more than it saves. Use the 1-hour TTL (
"ttl": "1h", 2× write) only for prefixes you reuse many times an hour (Anthropic prompt caching). - Gemini storage fees. Implicit caching on Gemini 2.5 and newer has no setup and no storage fee. Explicit caches on paid Flash models list storage at $0.50–$1.00 per hour (Gemini pricing). Delete them when you're done.
- Stacking Groq discounts. On Groq, a cached token in a batch request costs the same as an uncached one. The batch 50% replaces the cache discount (Groq prompt caching).
Cheapest LLM API Key: How to Get One and What It Actually Costs
An API key costs nothing on every major platform. What you actually pay depends on minimum top-ups, usage tiers that cap monthly spend, and tax rules where you live.
How the major platforms handle new accounts (as of October 2026; check the official page):
- OpenAI: the Free tier is limited to $100 a month. Moving up to Build tier takes $5 in total credit purchases and raises the cap to $500 a month. Launch ($100 purchased) raises it to $5,000 a month (OpenAI rate limits).
- Anthropic: the monthly spend caps are $500 (Start), $1,000 (Build) and $200,000 (Scale). New organizations may begin in a lower Evaluation tier. At the cap, requests return HTTP 429 until 00:00 UTC on the 1st of the next month (Anthropic rate limits).
- Google Gemini: the free tier needs an active project. Tier 1 needs a linked billing account, comes with a $250 spend cap, and "typically" takes effect instantly (Gemini rate limits).
To set a hard ceiling on a Claude key before you ship anything:
- Open the Claude Console and go to Billing (
platform.claude.com/settings/billing). - In the Spend limits section, click Adjust limit, or Set limit if you haven't set one before.
- Enter a monthly figure below your tier cap.
- To keep one project from using up another's budget, set separate workspace limits. You can't set a spend limit on the default workspace (Anthropic rate limits).
Your own limit returns HTTP 400 invalid_request_error when you hit it. The tier cap returns HTTP 429 with enforced_spend_limit_reached. That 429 has no retry-after header, so SDK auto-retries will keep failing until the month resets (Anthropic rate limits). Have your code detect that error code and fall back to a cheaper provider rather than retrying.
For a key-by-key look at when a Claude subscription beats paying per token, see our Claude API pricing vs Max plan break-even table.
Cheapest LLM API for Coding Tasks: Which Models Make Sense?
For coding, the cheapest model is usually one that caches your repo context well, not the one with the lowest list price. Coding agents send the same files and instructions on every turn.
Current coding-relevant options (as of October 2026; check the official page):
| Model | Input / output per 1M | Cached input per 1M | Note |
|---|---|---|---|
deepseek-flash (V4.1 Flash) | $0.30 / $1.20 peak, half off-peak | $0.006 peak | 1M context, 384K max output |
deepseek-v4-pro | $1.32 / $3.96 peak, half off-peak | $0.044 peak | lower concurrency (500 vs 2,500) |
qwen3-coder-flash (Alibaba, Singapore) | $0.30 / $1.50 up to 32K, $1.60 / $9.60 at 256K–1M | discount on input only | price rises with prompt length |
| Claude Haiku 5.5 | $0.10 / $0.50 | $0.01 | 512-token cache minimum |
| Claude Sonnet 5.5 | $2 / $10 | $0.10 | cache read is 0.05× input |
| GPT-6.1-Sol | $2 / $10 | $0.10 | cache read is 0.05× input |
Sources: DeepSeek pricing, Alibaba Cloud Model Studio pricing, Claude pricing, OpenAI pricing. The older DeepSeek-Coder and Qwen2.5-Coder models still show up in many lists. On the official APIs, the current names are deepseek-flash/deepseek-v4-pro and the Qwen3 Coder line.
Example (illustration, not a measurement): a coding agent sends 60K tokens of repo context on each of 200 turns a day and gets 1,500 output tokens per turn. That's 12M input and 0.3M output a day. Assume 95% of input hits the cache:
- Sonnet 5.5 with caching: 0.6M × $2 + 11.4M × $0.10 + 0.3M × $10 = $5.34 a day, plus cache writes. Without caching it would be $27.00.
- DeepSeek V4 Pro with caching (peak): 0.6M × $1.32 + 11.4M × $0.044 + 0.3M × $3.96 = about $2.48 a day.
- Qwen3 Coder Flash before any cache discount: a 60K prompt falls in the 32K–128K tier, so 12M × $0.50 + 0.3M × $2.50 = $6.75 a day.
The model with the lowest list price ends up more expensive than a mid-tier model that caches well. Coding quality varies too much between repos for a price table to settle it. Run the same 20 tasks from your backlog through two candidates and compare cost per task you'd actually merge.
Pitfalls: tiered pricing like Qwen's punishes "send the whole repo" agents, so trim context to what the task needs. DeepSeek V4 Pro's lower concurrency limit can throttle parallel agents.
Cheapest LLM API Provider Comparison: Reddit and Community Picks vs Official Pricing
Community threads usually rank providers by raw dollars per token. Check any pick against the official pricing and rate-limit pages before you switch, because those pages show the limits that decide whether it works for you.
When you see a "just use X, it's basically free" recommendation, check four things on the official pages:
| What to check | Why it matters | Example from official docs |
|---|---|---|
| Daily token or request cap | "Free" may not fit your traffic | Groq free plan: 30 RPM, 1K requests/day, 8K TPM, 200K tokens/day on GPT-OSS models (Groq rate limits) |
| Cache support per model | A cheap model without caching can lose to a cached one | Groq caching only covers the GPT-OSS models (Groq prompt caching) |
| Router limits | Aggregators add their own caps | OpenRouter :free models: 20 requests/min. 50 requests/day under $10 of lifetime credits, 1,000/day after (OpenRouter limits) |
| Whether the price is "enterprise" | Some listed models have no public price | Groq lists Llama 3.1 8B and 3.3 70B as "Enterprise pricing" (Groq models) |
Older posts are a common problem. A thread from last year may recommend a model that has since been renamed or retired, or a price that has changed. Copy the model ID from the provider's current models page rather than from a post. The same model can also cost different amounts at different hosts. DeepSeek V4.1 Flash on Together is $0.30 / $1.20 with $0.006 cached input (Together pricing), which matches DeepSeek's peak rate. Together doesn't offer DeepSeek's off-peak half price.
Cheapest LLM API in India: Regional Pricing and Payment Considerations
For users in India, the cheapest LLM API is the same as everywhere else, because the major providers bill in US dollars. What changes your real cost is tax handling and card conversion fees.
On OpenAI, you add a business Tax ID under your organization's billing preferences (OpenAI Help: Tax ID and VAT ID). One user on the OpenAI developer forum reported being charged 18% GST on credit top-ups until they added a GST number (OpenAI Community thread). That is a community report, not official policy, so confirm with your accountant. If you register, you then account for the tax yourself under reverse charge.
Example (illustration): a $20 top-up with 18% GST added becomes $23.60 before your bank's foreign-transaction markup. For a small project, that difference can matter more than the gap between two models' prices.
Practical steps:
- Ask your bank, before you choose a provider, whether your card charges a foreign currency markup on USD payments.
- If you have a GSTIN, add it to the billing profile before your first top-up. Tax on top-ups you've already made usually can't be undone afterward.
- Download invoices from the billing portal. OpenAI issues a separate tax invoice for GST jurisdictions on the same page (OpenAI Billing & Payment).
Local resellers that sell credits in INR may be easier to pay, but they set their own markup and their own data terms. Read their terms and compare their effective dollars-per-1M against the official table above. DeepSeek's off-peak window (outside 01:00–04:00 and 06:00–10:00 UTC on weekdays) covers much of the Indian evening, which helps teams that schedule batch-style jobs (DeepSeek pricing).
Cheapest LLM for International Students: Free Tiers and Credits Worth Using
For students, the cheapest LLM is a free tier: Gemini via Google AI Studio, Groq's free plan, or Alibaba's free quota for new accounts. Each one limits volume or uses your data, so none of them should hold up a production app.
| Free option | What you get | Main limitation |
|---|---|---|
| Gemini free tier | Free input/output on Flash and Flash-Lite models | Free-tier content may be used to improve Google's products. Limits are shown in AI Studio, not fixed (Gemini pricing, Gemini rate limits) |
| Groq free plan | GPT-OSS 20B/120B, very fast | 1K requests and 200K tokens per day (Groq rate limits) |
| Alibaba Model Studio | 1M free tokens per eligible model, valid 90 days (Singapore endpoint) | Expires; needs account approval (Alibaba pricing) |
OpenRouter :free models | Many open-weight models through one key | 50 requests/day until you've bought $10 of credits (OpenRouter limits) |
If an older guide sent you to GitHub Models, note that GitHub's documentation now says the service was retired on , and points users to Azure AI Foundry and GitHub Copilot (GitHub Docs).
Pitfall: don't put personal data, your university's data or anything under an NDA into a free tier whose terms allow training. Once your project has real users, move to a paid tier with a spend cap. On Gemini, Tier 1 starts with a $250 cap (Gemini rate limits), which limits how much a bug can cost you.
Cheapest LLM API for Agentic/Automation Tools (e.g., OpenClaw-Style Setups)
For agent tools like OpenClaw, the cheapest LLM API is whichever one your framework can cache properly. Agents resend the system prompt and tool definitions on every call, so cache hits make up most of the bill.
OpenClaw exposes caching through a cacheRetention setting with the values "none", "short" and "long". You can set it globally, per model or per agent. For direct Anthropic it defaults to "short". It sends prompt_cache_key to OpenAI automatically. For Gemini it creates and refreshes a cachedContents resource with a 300s or 3600s TTL (OpenClaw prompt caching).
To set it up:
- In your OpenClaw config, set the default (example values from the official docs):
agents:
defaults:
params:
cacheRetention: "long"
heartbeat:
every: "55m"
list:
- id: "alerts"
params:
cacheRetention: "none"
- Keep the heartbeat just under the cache TTL (
55mfor a 1-hour cache). That keeps idle agents from paying a fresh cache write each time they wake up. - Set
"none"for agents that run rarely, where a cache write would never be read back. - Turn on tracing with
OPENCLAW_CACHE_TRACE=1 pnpm start. Then check$OPENCLAW_STATE_DIR/logs/cache-trace.jsonlfor per-requestcacheReadandcacheWritecounts (OpenClaw prompt caching).
Things that break the cache, according to OpenClaw's docs: switching model or thinking level, timestamps or timezones in the system prompt, and changes to tool definitions or their order. Changing message content or tool-call IDs between turns breaks it too. If cacheWrite is high on every turn, look for one of these first.
Anthropic has one more advantage for agents. On most Claude models, cache reads don't count toward input-tokens-per-minute limits. Anthropic's example: a 2M ITPM limit with an 80% hit rate handles 10M total input tokens a minute (Anthropic rate limits). So a cache-friendly agent spends less and also gets more throughput from the same tier.
Next steps
You can cut your bill today by measuring your cache hit rate and putting a hard spend cap on every key.
DIY actions for today:
- Pull last month's usage and calculate your blended dollars-per-1M using the four steps in the caching section. Then re-price that usage with the two cheapest rows from the first table.
- Move stable content (system prompt, tool list, docs) to the start of every request and check that cache-hit tokens appear in the response usage fields.
- Set a monthly limit under Billing → Spend limits in the Claude Console, or link billing on Gemini Tier 1 with its $250 cap. Move anything that can wait 24 hours to a batch endpoint.
If you'd rather not manage several provider accounts, OpenRouter is a managed router: one key covers many models and providers. Its free models work with $0 of credit, and $10 of lifetime credit raises the free-model limit to 1,000 requests a day (OpenRouter limits). Paid models are billed from credits you top up (as of October 2026; check the official page). It suits prototypes and teams that switch models often. It's a poor fit if you need DeepSeek's off-peak rate or the exact cache control and data terms of a direct contract, and it adds another company that handles your prompts. If your team mostly uses Claude interactively rather than through code, a flat subscription may cost less. Our break-even table shows where that line falls.
Related guides on this site:
- LLM API Pricing Comparison 2026: 5 Providers, Real Costs
- Claude API Pricing vs Max Plan: Break-Even Table for 2026
FAQ
What is the cheapest LLM API key to start with for a side project?
Start with a Gemini free-tier key from Google AI Studio. It costs nothing and covers Flash and Flash-Lite models, but your content may be used to improve Google's products. When you need privacy or more volume, a $5 OpenAI credit purchase moves you to Build tier, where gpt-5-nano costs $0.05 / $0.40 per 1M tokens (OpenAI rate limits, OpenAI pricing).
What's the cheapest LLM API pricing structure overall (pay-as-you-go vs subscription)?
For uneven or automated traffic, pay-as-you-go with caching and batch is usually cheapest, because you pay only for tokens used and batch takes 50% off. Subscriptions are cheaper only for heavy, interactive use by one person. Our Claude break-even table works through that comparison.
Is there a genuinely free LLM API, or do all 'free' tiers have hidden limits?
Yes, free ones exist, but the limits are published rather than hidden. Groq's free plan caps GPT-OSS models at 200K tokens a day (Groq rate limits). OpenRouter allows 50 free-model requests a day until you've bought $10 of credits (OpenRouter limits). Gemini's free tier may use your data for product improvement.
How do I compare cheap LLM API pricing across providers without being misled by sticker price?
Price your own usage, split into uncached input, cached input, cache writes and output, then apply batch discounts to the share that can wait. In the example in this guide, DeepSeek Flash at peak goes from $21.00 to $9.24 once caching is counted. Re-check prices on the official pages before each budget cycle, since they change often.
Sources
- OpenAI API pricing
- OpenAI Batch API guide
- OpenAI prompt caching guide
- OpenAI rate limits and usage tiers
- OpenAI Help: Updating billing information, Tax ID, and VAT ID
- OpenAI Help: Billing & Payment
- OpenAI Developer Community: GST no longer charged after adding GST number
- Claude pricing
- Anthropic pricing docs
- Anthropic prompt caching docs
- Anthropic rate limits
- Gemini API pricing
- Gemini context caching
- Gemini rate limits
- DeepSeek models & pricing
- DeepSeek context caching
- Groq supported models
- Groq prompt caching
- Groq rate limits
- Together AI pricing
- Alibaba Cloud Model Studio model pricing
- OpenRouter API limits
- GitHub Docs: GitHub Models (retired)
- OpenClaw prompt caching reference
Spotted something out of date or wrong? Tell us at shigoto.ai.note@gmail.com. We check every guide against its official sources.