| LLM API cost comparison in 2026 spans $0.14 per million input tokens (DeepSeek V4 Flash) to $50 per million output tokens (Claude Fable 5.1). Choosing between OpenAI, Anthropic, Google, and Mistral depends on three billing dimensions most pricing pages bury: input cost, output cost, and context-length tier. LLM inference costs have fallen 140-fold since 2022. Prompt caching cuts input costs by up to 90% for workloads with repeated prefixes. This article covers current prices, the hidden costs headline rates conceal, and a selection guide by workload type. The Large Language Models subcategory on Universalnest.com maps the full pricing landscape. |
What You Actually Pay Per Million Tokens: Input, Output, and Context-Length Pricing
LLM API billing splits across three dimensions: input tokens (everything sent to the model, including system prompt, conversation history, retrieved context, and the user message), output tokens (the generated response), and context-length tiers where some providers charge more past a token-count threshold. Output tokens cost 3 to 6 times more than input tokens on almost every provider in 2026.
Input tokens accumulate from the system prompt, conversation history, retrieved document chunks in RAG applications, and the user message itself. For chat applications and RAG pipelines, input is typically the larger half of tokens per request. Output tokens represent what the model generates. For agentic workflows producing detailed plans, code reviews, or structured reports, output is where spending accumulates fastest.
Context-length pricing adds a third variable that headline comparisons rarely display. Gemini 3.1 Pro charges $2 per million input tokens and $12 per million output tokens for requests up to 200,000 tokens, then doubles to $4 input and $18 output past that threshold. Claude offers the full 1-million-token context window at standard pricing across all current model tiers with no long-context surcharge. That structural difference only becomes visible when workloads regularly exceed 128K tokens per request, at which point it is already significant.
Which dimension dominates your workload determines which provider offers the lowest actual cost.
LLM API Prices Across OpenAI, Anthropic, Google, and Mistral: August 2026 Rates
The $2 input tier is the most contested price point in August 2026, with Claude Sonnet 5, GPT-5.6 Terra, and Gemini 3.1 Pro all landing at exactly $2 per million input tokens. This convergence reflects direct competitive pricing rather than a cost-floor constraint: all three providers watched each other’s announcements and matched the number deliberately.
Output rates break ties within the mid-tier. Claude Sonnet 5 charges $10 per million output tokens while Gemini 3.1 Pro charges $12 at standard context length. For workloads generating significant output volume, that $2/MTok difference compounds quickly. At the frontier tier, Claude Opus 5 and GPT-5.6 Sol both start at $5 input, but Opus charges $25 per million output tokens versus Sol’s $30. For generation-heavy agentic workflows, Claude’s 17% output cost advantage on the same input price is the deciding factor at scale.
| Tier | Model | Input ($/MTok) | Output ($/MTok) | Context |
| Budget | Gemini 3.8 Flash | $0.10 | $0.40 | 1M |
| Budget | Mistral Small 4 | $0.15 | $0.60 | n/a |
| Budget | GPT-5.6 Luna | $0.20 | $1.20 | 1M |
| Mid | Claude Sonnet 5 | $2.00 | $10.00 (a) | 1M |
| Mid | GPT-5.6 Terra | $2.00 | $10.00-$15.00 | 1M |
| Mid | Gemini 3.1 Pro | $2.00 | $12.00 (b) | 1M |
| Frontier | Claude Opus 5 | $5.00 | $25.00 | 1M |
| Frontier | GPT-5.6 Sol | $4.00-$5.00 | $20.00-$30.00 | 1M |
| Ultra | Claude Fable 5.1 | $10.00 | $50.00 | 1M |
(a) Introductory rate through August 31, 2026; reverts to $3.00 input/$15.00 output on September 1. (b) Doubles past 200K tokens per request to $4.00 input/$18.00 output.
Three Hidden Costs That LLM API Headline Prices Do Not Show
Three costs that headline input prices omit determine real-world spend more than the listed rate: the output token ratio, context-length price jumps, and thinking token billing from reasoning model configurations.
- Output ratio trap. Output tokens cost 3 to 6 times more than input tokens on every major provider. A team comparing two models on input price alone misses the dimension that dominates most production bills. At the flagship tier, Claude Opus 5 and GPT-5.6 Sol both charge $5 input. Opus charges $25 output versus Sol’s $30. At scale, that output gap is material.
- Context-length price jump. Gemini 3.1 Pro charges $2 input at standard context length and doubles to $4 past 200,000 tokens per request. Teams running large-document analysis on Gemini who budget around the headline rate find their actual bill at 2x for those requests. Claude’s no-surcharge architecture is a concrete advantage once prompts regularly exceed 128K tokens, not just a marketing point.
- Thinking tokens. Reasoning model configurations generate internal traces that bill at the same output rate. How reasoning model thinking tokens add to per-request API cost in 2026 is covered in the reasoning models guide.
How Prompt Caching Cuts LLM API Input Costs by Up to 90%
Prompt caching stores computed attention tensors for a repeated prompt prefix server-side. Subsequent requests sharing the same prefix skip recomputation and bill cached tokens at 0.1 times the standard input rate, a 90% saving with no change to output quality.
Example: a RAG chatbot sends an 8,000-token system prompt with every user message. At Claude Sonnet 4.6’s standard $3 per million input tokens, that repeated context costs $24 per million messages. With caching: $0.30 per million, 90% cheaper with identical output. The academic study “Don’t Break the Cache” (arXiv 2601.06007, 2026) tested caching across 500 agent sessions with 10,000-token system prompts and found 41 to 80% API cost reduction alongside 13 to 31% faster time-to-first-token.
Each major provider implements caching differently in 2026.
| Provider | Activation | Read Cost | Write Cost | Retention |
| Anthropic (Claude) | Explicit cache_control marker required | 0.1x standard input | 1.25x (5-min TTL) or 2x (1-hour TTL) | 5 or 60 minutes |
| OpenAI (GPT-5.6+) | Automatic from 1,024-token prefix | 0.1x standard input | 1.25x write surcharge | 30 minutes |
| Google (Gemini 2.5+) | Implicit by default | Storage fee $1/MTok/hour | Context cache creation cost | Per-hour billing |
For async, non-time-critical workloads, the OpenAI Batch API adds a 50% flat discount on both input and output tokens. Anthropic supports equivalent async processing through AWS Bedrock and Vertex AI integration rather than a direct Batch API.
Which LLM API Tier Fits Your Workload: A Practical Selection Guide
Choosing a provider tier by workload type rather than headline input price produces lower total cost because the cheapest input rate often pairs with the highest output rate or lacks the context window the task needs.
Budget tiers ($0.10 to $0.25 input) serve chat, text classification, short summarisation, and asynchronous batch label jobs where output per request is short, and quality requirements are moderate. Latency is acceptable at lower quality tiers. Mid-tier models at $2 input are the most competitive bracket in 2026 for production RAG pipelines, coding assistants, and customer chatbots. All three providers match on input; output rate and context-length pricing are the real differentiators. Frontier models ($4 to $5 input) justify their cost when task error carries real remediation cost that exceeds the savings from downgrading.
| Use Case | Recommended Tier | Key Consideration |
| Chat and short Q&A | Budget ($0.10-$0.20) | Input-heavy; output cost less critical |
| RAG application | Mid ($2/MTok) | Caching required; compare output rates |
| Coding assistant | Mid or Frontier | SWE-bench score vs API cost trade-off |
| Long document analysis | Mid, Claude preferred | Avoid Gemini 200K context price jump |
| Agentic multi-step workflow | Frontier | Output volume high; caching critical |
| Async batch jobs | Budget plus Batch API | 50% discount on OpenAI async |
How LLM API Prices Have Fallen Since 2022 and What Drives the Next Drop
LLM inference cost fell from approximately $20 per million tokens in 2022 to $0.14 per million tokens for the cheapest capable model in August 2026, a 140-fold decline driven by hardware efficiency, model architecture improvements, and sustained competition across providers.
The 30 to 50% year-over-year decline has been consistent since 2023. New model generations reset the price floor when providers cut rates on older models, and open-weight alternatives from DeepSeek and Mistral set a cost ceiling that closed-source providers must price below to retain customers.
The $2 input tier is the current competitive floor for mid-tier models. All three major Western providers have converged here, and the dynamics at this price point signal that further cuts will follow. Teams building production workloads should assume at least a 30 to 40% further decline in the next 12 months and design architecture to take advantage of better pricing at the next generation release.
LLM API pricing in 2026 is not a static comparison. Introductory rates revert on announced dates, context-length surcharges activate at thresholds that only appear at scale, and the provider leading on cost today may be third next quarter. Three habits protect against budget surprises: track output rates separately from input rates, enable prompt caching before moving to production, and verify context-length pricing tiers for any workload that regularly exceeds 128K tokens per request.
What LLM API Pricing in 2026 Confirms About the Market
LLM API costs have fallen 140-fold since 2022 and are still declining at 30 to 50% per year. The $2 input tier is the current competitive floor where OpenAI, Anthropic, and Google all meet.
Real differentiation comes from output rates, context-length surcharges, and caching mechanics rather than headline input prices. Three decisions matter: confirm the output rate for your workload’s generation volume, check context-length pricing tiers for prompts above 128K tokens, and enable prompt caching before production deployment. Universalnest covers the complete Large Language Models subcategory across how these models are priced, compared, and deployed in 2026.
Frequently Asked Questions
What is the cheapest LLM API in 2026?
As of August 2026, DeepSeek V4 Flash is the cheapest capable LLM API at $0.14 per million input tokens and $0.28 per million output tokens, with cache-hit input near $0.003. Gemini 3.8 Flash ($0.10/$0.40) and Mistral Small 4 ($0.15/$0.60) are close alternatives among major provider families.
Why do output tokens cost more than input tokens?
Generating output tokens requires autoregressive decoding, running the model for each token individually rather than processing input tokens in parallel. This is more compute-intensive, which is why output tokens are priced at 3 to 6 times the input rate on almost every provider. Response length is the most important cost driver.
What is prompt caching and how much can it save?
Prompt caching stores computed attention tensors server-side for a repeated prompt prefix. Subsequent requests using the same prefix bill cached tokens at 0.1 times the standard rate, a 90% saving. A RAG chatbot sending an 8,000-token system prompt with every message saves approximately 90% on those repeated input tokens once caching is enabled.
Does Gemini 3.1 Pro charge more for long documents?
Yes. Gemini 3.1 Pro charges $2.00 per million input tokens for prompts up to 200K tokens, then doubles to $4.00 past that threshold per request. Output also doubles from $12.00 to $18.00. Claude offers the full 1-million-token context window at standard rates with no long-context surcharge on any current model.
What is the Batch API and which providers offer it?
The Batch API processes API requests asynchronously at a 50% flat discount on both input and output tokens for non-time-critical workloads. OpenAI offers a direct Batch API. Anthropic supports async batch processing through AWS Bedrock and Vertex AI integration but does not offer a direct batch discount through its own API.
1 Comment
Comments are closed.