Per MillionLLM API prices, tracked daily

Cheapest LLM API in 2026: Real Cost per 1M Tokens Table

By Per Million · Published · 17 min read

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.

Which option is right for you?. Source: the LiteLLM price list (MIT License)
Your situationWhat to pick firstFirst page to open
Beginner or student, $0 budgetGemini free tier (Flash or Flash-Lite). No card needed, but your prompts may be used for trainingGemini API pricing
Daily work use, short prompts, high volumegpt-5-nano or GPT-6-Luna, with Batch for anything that can wait 24hOpenAI API pricing
Long repeated context (RAG, agents, coding)deepseek-flash during off-peak hours. Its cache-hit price is the lowest listedDeepSeek pricing
Tight budget, need fast open-weight modelGroq gpt-oss-20b ($0.075 / $0.30)Groq models
You want quality plus a predictable billClaude Haiku 5.5 with prompt caching and a Console spend limitClaude pricing
Coding agent on a large repoA 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.

What Is the Cheapest LLM API Right Now?. Source: the LiteLLM price list (MIT License)
Model (provider)Input / output per 1MCached input per 1MExample, no cachingExample, 80% cachedExample, 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.3050% 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.62no batch API
deepseek-flash, peak$0.30 / $1.20$0.006$21.00$9.24no batch API
Llama 3.1 8B Instruct Lite (Together)$0.14 / $0.14none listed$7.70$7.70not 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:

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):

How Do Prompt Caching and Batch Discounts Change the Real Cost Per 1M Tokens?. Source: the LiteLLM price list (MIT License)
ProviderCache read priceCache write costMinimum prefixBatch discount
OpenAI0.1× input (0.05× for GPT-6.1-Sol)none by default; 12h retention costs more1,024 tokens (GPT-5.6+)50%, within 24h
Anthropic0.1× input (0.05× for Opus/Sonnet 5.5)1.25× (5 min) or 2× (1 hour)512 tokens on 5.5 models50%
Google Gemini~5–10% of input, implicit by defaultexplicit caches add hourly storage4,096 tokens on 3.x Flash50%
DeepSeek~2% of cache-miss pricenone listedprefix units, automaticnone; off-peak 50% instead
Groq50% off input (GPT-OSS models only)none128–1,024 tokens50%, 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:

  1. 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_tokens and prompt_cache_miss_tokens in every response (DeepSeek caching). Anthropic returns cache_read_input_tokens, cache_creation_input_tokens and input_tokens (Anthropic rate limits).
  2. Multiply each bucket by its own price: uncached × input price, cached × cache-read price, writes × write price, output × output price.
  3. 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.
  4. 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:

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):

To set a hard ceiling on a Claude key before you ship anything:

  1. Open the Claude Console and go to Billing (platform.claude.com/settings/billing).
  2. In the Spend limits section, click Adjust limit, or Set limit if you haven't set one before.
  3. Enter a monthly figure below your tier cap.
  4. 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):

Cheapest LLM API for Coding Tasks: Which Models Make Sense?. Source: the LiteLLM price list (MIT License)
ModelInput / output per 1MCached input per 1MNote
deepseek-flash (V4.1 Flash)$0.30 / $1.20 peak, half off-peak$0.006 peak1M context, 384K max output
deepseek-v4-pro$1.32 / $3.96 peak, half off-peak$0.044 peaklower concurrency (500 vs 2,500)
qwen3-coder-flash (Alibaba, Singapore)$0.30 / $1.50 up to 32K, $1.60 / $9.60 at 256K–1Mdiscount on input onlyprice rises with prompt length
Claude Haiku 5.5$0.10 / $0.50$0.01512-token cache minimum
Claude Sonnet 5.5$2 / $10$0.10cache read is 0.05× input
GPT-6.1-Sol$2 / $10$0.10cache 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:

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:

Cheapest LLM API Provider Comparison: Reddit and Community Picks vs Official Pricing. Source: the LiteLLM price list (MIT License)
What to checkWhy it mattersExample from official docs
Daily token or request cap"Free" may not fit your trafficGroq free plan: 30 RPM, 1K requests/day, 8K TPM, 200K tokens/day on GPT-OSS models (Groq rate limits)
Cache support per modelA cheap model without caching can lose to a cached oneGroq caching only covers the GPT-OSS models (Groq prompt caching)
Router limitsAggregators add their own capsOpenRouter :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 priceGroq 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:

  1. Ask your bank, before you choose a provider, whether your card charges a foreign currency markup on USD payments.
  2. 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.
  3. 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.

Cheapest LLM for International Students: Free Tiers and Credits Worth Using. Source: the LiteLLM price list (MIT License)
Free optionWhat you getMain limitation
Gemini free tierFree input/output on Flash and Flash-Lite modelsFree-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 planGPT-OSS 20B/120B, very fast1K requests and 200K tokens per day (Groq rate limits)
Alibaba Model Studio1M free tokens per eligible model, valid 90 days (Singapore endpoint)Expires; needs account approval (Alibaba pricing)
OpenRouter :free modelsMany open-weight models through one key50 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:

  1. 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"
  1. Keep the heartbeat just under the cache TTL (55m for a 1-hour cache). That keeps idle agents from paying a fresh cache write each time they wake up.
  2. Set "none" for agents that run rarely, where a cache write would never be read back.
  3. Turn on tracing with OPENCLAW_CACHE_TRACE=1 pnpm start. Then check $OPENCLAW_STATE_DIR/logs/cache-trace.jsonl for per-request cacheRead and cacheWrite counts (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:

  1. 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.
  2. 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.
  3. 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:

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

Spotted something out of date or wrong? Tell us at shigoto.ai.note@gmail.com. We check every guide against its official sources.