Pricing Guide

LLM API Pricing Comparison: Open vs Frontier Models

By Rome Thorndike · April 2, 2026 · 12 min read

Full Model Pricing Comparison

For the complete multi-provider pricing table with GPT-4.1, Claude Opus, Gemini Pro, Llama 4, and 15+ models compared, see LLM Pricing 2026: Every Model from $0.01 to $75/1M. This page covers token cost fundamentals and batch/caching discount calculations.

An LLM API pricing comparison starts with the gap most provider tables bury. Llama 4 Scout via hosted providers starts around $0.10/1M input tokens, while Claude Opus 4.6 costs $15.00 input / $75.00 output per 1M tokens.

That gap changes which model belongs in production. Hosted open models can handle high-volume classification, extraction, routing, and first-pass drafting without turning routine work into a money pit. Frontier APIs earn their higher rates when output quality changes the result: difficult reasoning, important customer-facing writing, or agent work where a weak answer creates more cleanup downstream.

Prices below are per one million tokens. Input is what your application sends to the model. Output is what it generates back. Both sides of the bill matter, especially for applications that produce long answers, summaries, code, or tool traces.

A low input price can look great until the model starts producing a lot of output. Budgeting from input alone is how teams convince themselves a feature is cheap right before the invoice arrives.

For the broader provider list, see the LLM pricing 2026 full table. For workload estimates and token math, use the LLM token pricing guide.

TLDR

Hosted Llama and DeepSeek APIs can cut token costs sharply for high-volume work. Claude, GPT, and Gemini cost more, particularly on output. Split routine routing, extraction, and drafting from work where frontier quality changes the result, then price input and output separately.

Key Takeaways

  • Hosted Llama and DeepSeek models offer the lowest listed rates for volume-heavy API workloads.
  • Claude Sonnet and Opus charge a large premium on generated output.
  • GPT-4o Mini sits closer to hosted open-model pricing than frontier-tier output pricing.
  • Gemini 2.5 Pro pricing depends on prompt size, so workload shape affects the bill.
  • Batch processing and prompt caching can matter as much as model choice for repeatable workloads.

Master Pricing Table: All Major LLM APIs

Prices are per 1 million tokens. Input is what you send to the model. Output is what the model generates back. Every model charges differently for each direction because output tokens require more compute.

Provider Model Input / 1M Tokens Output / 1M Tokens Context Window
OpenAI
OpenAIGPT-5$1.25$10.00128K
OpenAIGPT-4.1$2.00$8.001M
OpenAIGPT-4.1 Mini$0.40$1.601M
OpenAIGPT-4.1 Nano$0.10$0.401M
OpenAIGPT-4o$2.50$10.00128K
OpenAIGPT-4o Mini$0.15$0.60128K
OpenAIo3$10.00$40.00200K
OpenAIo4-mini$1.10$4.40200K
Anthropic
AnthropicClaude Opus 4.6$15.00$75.001M
AnthropicClaude Sonnet 4.6$3.00$15.001M
AnthropicClaude Haiku 4.5$0.80$4.00200K
Google
GoogleGemini 2.5 Pro$1.25$10.001M
GoogleGemini 2.0 Flash$0.10$0.401M
Mistral
MistralMistral Large$2.00$6.00128K
MistralMistral Small$0.10$0.30128K
Cohere
CohereCommand R+$2.50$10.00128K
CohereCommand R$0.15$0.60128K

Note on Gemini 2.5 Pro: Google charges $1.25/$10 for prompts over 200K tokens. Under 200K, input drops to $0.625 and output to $5.00. The table shows the higher tier since most production use cases hit the 200K+ range with system prompts and context.

Models by Budget Tier

Not every project needs a frontier model. Here is how models break down by cost, so you can match your budget to the right capability level.

Under $1 per 1M Input Tokens (Budget Tier)

These models handle classification, extraction, summarization, and simple chat at rock-bottom prices.

ModelInput / 1MOutput / 1MBest For
GPT-4.1 Nano$0.10$0.40High-volume classification, simple extraction
Gemini 2.0 Flash$0.10$0.40Fast inference, multimodal on a budget
Mistral Small$0.10$0.30Lightweight European-hosted tasks
GPT-4o Mini$0.15$0.60General-purpose cheap model
Command R$0.15$0.60RAG-optimized retrieval tasks
GPT-4.1 Mini$0.40$1.60Coding and instruction following on a budget
Claude Haiku 4.5$0.80$4.00Fast responses, customer-facing chat

$1 to $5 per 1M Input Tokens (Mid-Range)

The sweet spot for most production applications. These models handle complex reasoning, coding, and multi-step tasks reliably.

ModelInput / 1MOutput / 1MBest For
o4-mini$1.10$4.40Reasoning tasks at mid-range cost
GPT-5$1.25$10.00Frontier general intelligence
Gemini 2.5 Pro$1.25$10.00Long-context analysis, multimodal
GPT-4.1$2.00$8.00Coding, long-context, instruction following
Mistral Large$2.00$6.00European data residency, multilingual
GPT-4o$2.50$10.00Multimodal (vision + text)
Command R+$2.50$10.00Enterprise RAG, grounded generation
Claude Sonnet 4.6$3.00$15.00Coding, analysis, agentic workflows

$5+ per 1M Input Tokens (Premium)

ModelInput / 1MOutput / 1MBest For
o3$10.00$40.00Hard reasoning, math, science problems
Claude Opus 4.6$15.00$75.00Complex agentic tasks, deep analysis

Premium models are rarely needed for production workloads. Use them for difficult reasoning tasks, complex code generation, or when accuracy on edge cases justifies the 10-50x cost increase over mid-range options.

Batch API Discounts

If your workload can tolerate latency (minutes to hours instead of seconds), batch APIs cut costs significantly.

ProviderBatch DiscountTypical LatencyHow It Works
OpenAI50% off all modelsUp to 24 hoursSubmit JSONL file, results returned asynchronously. Available for all GPT and o-series models.
Anthropic50% off all modelsUp to 24 hoursMessage Batches API. Submit up to 100,000 requests per batch. Results within 24 hours.
Google50% off Gemini modelsUp to 24 hoursBatchGenerateContent API. Minimum 2x discount on all Gemini models through Vertex AI.
MistralVariableVariesBatch inference available through La Plateforme. Discount varies by volume commitment.

With batch pricing, GPT-4.1 drops to $1.00 input / $4.00 output per million tokens. Claude Sonnet 4.6 drops to $1.50 / $7.50. These are significant savings for data processing pipelines, evaluation runs, and content generation at scale.

Prompt Caching

Prompt caching reduces costs when you send the same system prompt or context prefix repeatedly. Instead of reprocessing identical tokens every call, the provider caches them and charges a reduced rate.

ProviderCache Write CostCache Read DiscountTTLMin Tokens
OpenAIFree (automatic)50% off input5-10 min1,024
Anthropic25% surcharge on first write90% off input5 min (refreshes on hit)1,024 (Haiku), 2,048 (Sonnet/Opus)
GoogleSame as input75% off inputConfigurable32,768

Anthropic's caching is the most aggressive: 90% off cached input tokens means a long system prompt that costs $3.00/1M on Sonnet 4.6 drops to $0.30/1M on cache hits. The 25% write surcharge pays for itself after just a few requests. OpenAI's caching is automatic (no code changes needed) but gives a smaller discount. Google requires the most tokens before caching kicks in but offers configurable TTL.

Cost Per 1K Tokens (Conversion Table)

Some documentation and older pricing pages still reference cost per 1,000 tokens. To convert: divide the per-1M price by 1,000.

ModelInput / 1K TokensOutput / 1K Tokens
GPT-4.1 Nano$0.0001$0.0004
Gemini 2.0 Flash$0.0001$0.0004
GPT-4o Mini$0.00015$0.0006
GPT-4.1 Mini$0.0004$0.0016
Claude Haiku 4.5$0.0008$0.004
GPT-5$0.00125$0.01
GPT-4.1$0.002$0.008
Claude Sonnet 4.6$0.003$0.015
GPT-4o$0.0025$0.01
o3$0.01$0.04
Claude Opus 4.6$0.015$0.075

Per-1K pricing looks deceptively cheap. Always multiply by 1,000 to understand real costs at scale. A chatbot handling 1 million tokens per day at $0.002/1K input costs $2/day or $60/month just for input tokens.

How to Estimate Your Monthly API Costs

Use this formula to budget your LLM spend before committing to a provider.

Monthly Cost = (Daily Requests x Avg Input Tokens x Input Price/1M) + (Daily Requests x Avg Output Tokens x Output Price/1M) x 30

Example 1: Customer Support Chatbot

  • 500 conversations/day, 800 input tokens avg (system prompt + user message), 400 output tokens avg
  • Using Claude Sonnet 4.6 ($3/$15 per 1M)
  • Input: 500 x 800 = 400,000 tokens/day = $1.20/day
  • Output: 500 x 400 = 200,000 tokens/day = $3.00/day
  • Monthly: ($1.20 + $3.00) x 30 = $126/month

Example 2: Document Processing Pipeline

  • 200 documents/day, 5,000 input tokens avg (document + extraction prompt), 500 output tokens avg
  • Using GPT-4.1 Mini ($0.40/$1.60 per 1M)
  • Input: 200 x 5,000 = 1,000,000 tokens/day = $0.40/day
  • Output: 200 x 500 = 100,000 tokens/day = $0.16/day
  • Monthly: ($0.40 + $0.16) x 30 = $16.80/month

Example 3: High-Volume Classification

  • 50,000 items/day, 200 input tokens avg, 50 output tokens avg
  • Using GPT-4.1 Nano ($0.10/$0.40 per 1M)
  • Input: 50,000 x 200 = 10,000,000 tokens/day = $1.00/day
  • Output: 50,000 x 50 = 2,500,000 tokens/day = $1.00/day
  • Monthly: ($1.00 + $1.00) x 30 = $60/month

These estimates assume no caching or batching. With prompt caching on a chatbot (where the system prompt repeats), expect 30-60% lower input costs. With batch API, cut both input and output costs in half.

Provider Comparison by Use Case

Cheapest for High-Volume Chatbots

Winner: GPT-4.1 Nano ($0.10/$0.40) or Gemini 2.0 Flash ($0.10/$0.40). Both cost the same and handle conversational tasks well. Gemini Flash has the edge for multimodal inputs (images in chat). GPT-4.1 Nano has stronger instruction following for structured system prompts. Mistral Small ($0.10/$0.30) is cheapest on output if you need European data residency.

Best for Coding Assistants

Winner: Claude Sonnet 4.6 ($3/$15). Consistently top-ranked on coding benchmarks. GPT-4.1 ($2/$8) is a strong alternative at lower cost, especially for its 1M context window that fits entire codebases. For budget coding, GPT-4.1 Mini ($0.40/$1.60) punches well above its price.

Best for Complex Reasoning

Winner: o3 ($10/$40) for math-heavy and scientific reasoning. Claude Opus 4.6 ($15/$75) for detail-sensitive analysis and agentic multi-step tasks. These are premium models for premium problems. For most reasoning tasks, Claude Sonnet 4.6 or GPT-5 at a fraction of the cost will be sufficient.

Best for RAG and Retrieval

Winner: Command R+ ($2.50/$10). Cohere built Command R+ specifically for retrieval-augmented generation with built-in citation support. Google Gemini 2.5 Pro is the alternative when you need a massive context window (1M tokens) to stuff retrieved documents into a single prompt.

Best for Enterprise with Data Residency Requirements

Winner: Mistral Large ($2/$6). Hosted in Europe, strong multilingual performance, and competitive pricing. Mistral is the default choice when GDPR compliance and data residency are non-negotiable.

Open Model APIs vs Frontier Models: The Price Gap

Hosted open models are the budget tier in this comparison. Llama 4 Maverick from providers like Together AI runs $0.15-$0.30 per million input tokens. DeepSeek V3 prices at $0.14/$0.28 per million input/output tokens.

Those rates put open-model hosting in a different spending category from premium frontier APIs. Claude Sonnet 4.6 costs $3.00 input / $15.00 output per 1M tokens. Claude Opus 4.6 costs $15.00 input / $75.00 output per 1M tokens.

The cleanest use for a hosted open model is work where the request pattern is stable and the output has a narrow job. Pull fields from documents. Sort inbound tickets. Decide where a request should go. Draft an internal summary that a person or a stronger model will review. These workloads reward low token cost because volume, rather than one exceptional answer, drives the economics.

Frontier models belong where their output avoids an expensive mistake or produces work you would otherwise need to redo. That can include complex code generation, detailed analysis, high-stakes customer communication, or multi-step agent tasks. The premium is easier to defend when a weak answer creates more calls, more review, or a poor user experience.

There is no universal winner. A cheap model can lose if it creates enough cleanup. An expensive model can lose if it handles every trivial request in the product. The useful architecture separates jobs by consequence.

A common split uses a lower-cost model for the first pass and reserves a frontier call for uncertain or high-value cases. That keeps routine traffic from consuming premium capacity while giving difficult requests a stronger path. It also gives teams a clean way to test quality against spend instead of debating model rankings in the abstract.

Hosted Open-Model Pricing (Llama and DeepSeek per-token rates)

Together AI-style hosts matter because they turn open weights into a normal API purchase. Your team does not need to operate its own inference stack, negotiate hardware access, or wait for an infrastructure project before testing whether an open model fits a workload.

Llama 4 Scout via hosted providers starts around $0.10/1M input tokens. Llama 4 Maverick from providers like Together AI runs $0.15-$0.30 per million input tokens.

DeepSeek V3 is particularly easy to place in a budget model tier because it has rates on both sides of the transaction: $0.14/$0.28 per million input/output tokens. That makes it easier to estimate workloads that generate substantial text rather than treating output as an afterthought.

Hosted pricing has a practical advantage over a self-hosting spreadsheet. You can start with a model API, see how it behaves on your own prompts, and move on if it misses the mark. For many teams, that is enough. The operational savings from self-hosting only show up after the engineering and reliability burden has a real reason to exist.

Open-model hosts also give product teams another routing option. A user request does not need the same model every time. Short classification work can go to the least expensive capable option. A request that needs a polished explanation, hard reasoning, or careful tool use can move up the stack.

That routing logic gets more valuable as volume grows. It is hard to justify premium output pricing for a task that has a fixed format and an easy review path. It is equally hard to justify a bargain model for a task where one bad response harms the customer relationship.

Prompt caching and batch workflows can narrow costs further when prompts repeat. A shared system prompt, repeated documents, or a queue of non-urgent tasks changes the economics because the model choice is only one part of the final bill. Teams should price the actual request shape: prompt length, expected response length, repetition, and whether work can wait for a batch.

The LLM pricing per million tokens page is useful when you need to compare those rates against a specific token budget rather than a generic model category.

Anthropic Claude Pricing Per Million Tokens

Claude pricing is straightforward when you separate Sonnet from Opus and input from output. Claude Sonnet 4.6 costs $3.00 input / $15.00 output per 1M tokens. Claude Opus 4.6 costs $15.00 input / $75.00 output per 1M tokens.

The output spread is where budget owners should linger. Generated tokens cost more than prompt tokens across these models, and the Claude rates make that particularly visible. An application that asks for concise labels has a different cost profile from one that asks for long analyses, multi-file code changes, or agent traces.

Sonnet is the more plausible default for teams that want a premium model in a production path but still need to watch usage. Opus belongs in a narrower lane where the extra capability is worth paying for. Putting it behind every feature is an expensive form of indecision.

The same rule applies to evaluation. Test models on the work users will actually submit. A benchmark result can be useful, but a model only earns its rate if it improves the answer your customer receives or lowers the work your team has to do after the answer arrives.

A sensible procurement conversation starts with the high-volume jobs. Which requests can accept a hosted open model? Which need Sonnet? Which rare cases justify Opus? Those choices create a cost policy that engineering can implement, finance can understand, and product can defend.

Frontier vs Budget Models Side by Side

The table keeps input and output separate because a single blended number hides too much. These are published per-million-token rates, and every row below comes from the listed pricing sources.

ModelCategoryInput per 1M tokensOutput per 1M tokensBest fit
Llama 4 ScoutHosted open model$0.10n/aLow-cost input-heavy work
DeepSeek V3Hosted open model$0.14$0.28Budget work with generated output
Llama 4 MaverickHosted open model$0.15-$0.30n/aHosted open-model API workloads
GPT-4o MiniBudget proprietary model$0.15$0.60Low-cost proprietary API work
Gemini 2.5 Pro, prompts under 200K tokensFrontier model$0.625$5.00Premium work with shorter prompts
GPT-5Frontier model$1.25$10.00Higher-capability API tasks
Claude Sonnet 4.6Frontier model$3.00$15.00Premium production workloads
Claude Opus 4.6Frontier model$15.00$75.00Difficult work where quality has a high value

GPT-4o Mini provides another reference point for budget API work. It costs $0.15 input / $0.60 output per 1M tokens. Its input rate sits close to the hosted open-model range, while its output rate remains above DeepSeek V3.

GPT-5 costs $1.25 input / $10.00 output per 1M tokens. That places it above the budget tier but below Claude Sonnet on the listed input and output rates.

Gemini 2.5 Pro adds a condition worth keeping in the pricing model. Prompts under 200K tokens price at $0.625 input and $5.00 output per 1M. Long-context use cases need their own estimate because prompt size is part of the rate structure.

A comparison table should guide model routing, not replace it. The cheapest row is useful when the task tolerates it. The most expensive row is useful when the output saves enough time or risk to pay for itself. Most production systems need both.

How to Choose a Model Without Losing the Cost Plot

Start with the work, not the model brand. Separate requests into jobs: extraction, classification, search-result synthesis, drafting, coding, customer support, and agent execution. Each category has different tolerance for latency, mistakes, and weak reasoning.

Then look at the output profile. Applications that generate a few labels or a short JSON object often care most about input price. Applications that create lengthy explanations, reports, code, or multi-step traces need to watch output pricing closely. The more text your product generates, the less useful an input-only comparison becomes.

Next, identify where prompts repeat. Repeated instructions, reusable context, and queued work create room for caching or batching. A model with a higher public rate can still fit a workflow if the request design reduces paid work. A cheap model can become wasteful if prompts are bloated and responses are allowed to run without a clear stopping point.

Quality evaluation should be concrete. Use representative prompts. Check whether the output follows the required format, gets the important facts right, uses tools correctly, and needs a reviewer to repair it. Cost per token is only part of the expense. Human cleanup has a price too, even when it does not appear on an API invoice.

The strongest setup usually has a default tier and an escalation path. Send routine work to a low-cost hosted or budget model. Escalate only when the request needs better reasoning, stronger writing, or more dependable tool use. That is how a team gets premium capability without assigning a premium rate to every request.

For internal links to deeper coverage, see Anthropic Claude API Pricing for the full Anthropic-specific breakdown, Best Open-Source LLMs for model-quality comparisons across Llama, Mistral, Qwen, and DeepSeek, and AI Free Tiers Compared for which providers give you the most before billing kicks in.

Frequently Asked Questions

What is the cheapest LLM API?

As of April 2026, the cheapest LLM APIs are GPT-4.1 Nano, Gemini 2.0 Flash, and Mistral Small, all at $0.10 per million input tokens. Mistral Small edges ahead on output cost at $0.30/1M vs $0.40/1M for the other two. For batch workloads, GPT-4.1 Nano with the 50% batch discount drops to $0.05/$0.20 per million tokens, making it the absolute cheapest option for asynchronous processing.

How much does GPT-4.1 cost per token?

GPT-4.1 costs $2.00 per million input tokens and $8.00 per million output tokens. That works out to $0.000002 per input token and $0.000008 per output token. With the OpenAI Batch API (50% discount), those drop to $1.00/$4.00 per million. With prompt caching (automatic, 50% off cached tokens), repeated system prompts cost $1.00 per million cached input tokens.

How do LLM API prices compare to self-hosting?

Self-hosting open-source models (Llama 3, Mistral, etc.) on your own GPUs costs roughly $1-3 per GPU-hour on cloud providers. At high volume (millions of tokens per day), self-hosting can be 50-80% cheaper than API pricing. At low to moderate volume, APIs are almost always cheaper because you avoid idle GPU costs, infrastructure management, and the engineering overhead of running inference servers. The break-even point is typically around 10-50 million tokens per day, depending on the model size and hardware choice.

What's the difference between input and output token pricing?

Input tokens are what you send to the model: your system prompt, user message, uploaded documents, and any context. Output tokens are what the model generates in response. Output tokens cost 2-5x more than input tokens because generating each output token requires a full forward pass through the model, while input tokens can be processed in parallel. This is why long system prompts with short responses are relatively cheap, while asking a model to write a 5,000-word essay gets expensive fast.

Which LLM API has the best free tier?

Google offers the most generous free tier through Google AI Studio: Gemini 2.0 Flash is free up to 15 requests per minute with generous daily limits. OpenAI offers limited free credits for new accounts. Anthropic provides free access through claude.ai but no free API tier. Mistral offers a free tier on La Plateforme with rate limits. For serious development and testing, Google's free Gemini access is the clear winner.

How often do LLM API prices change?

Prices have been trending down 30-50% per year since 2023. Major price drops usually happen when providers release new model generations (the old model gets cheaper or the new model matches performance at lower cost). OpenAI and Google have been the most aggressive on price cuts. Anthropic tends to hold pricing longer but offers batch and caching discounts. Expect at least 2-3 significant pricing changes per provider per year.

Is an open model API really cheaper than a frontier model API in 2026?

Yes for many volume tiers. Llama 4 Scout via hosted providers starts around $0.10/1M input tokens, and DeepSeek V3 prices at $0.14/$0.28 per million input/output tokens, while Claude Sonnet 4.6 costs $3.00 input / $15.00 output per 1M tokens and Claude Opus 4.6 costs $15.00 input / $75.00 output per 1M tokens. The savings are real for high-volume chat, RAG, classification, and summarization. Frontier models still lead on hard reasoning, agent work, and frontier coding, and budget proprietary options like GPT-4o Mini at $0.15/$0.60 sit close to hosted open-model rates.

Which open model API has the cheapest input tokens in 2026?

Llama 4 Scout via hosted providers starts around $0.10/1M input tokens. Llama 4 Maverick from providers like Together AI runs $0.15-$0.30 per million input tokens, and DeepSeek V3 prices at $0.14/$0.28 per million input/output tokens, which makes it the easiest to budget for output-heavy work.

How does DeepSeek-V3 pricing compare to GPT-4.1 and Claude Sonnet 4.6?

DeepSeek V3 prices at $0.14/$0.28 per million input/output tokens. Claude Sonnet 4.6 costs $3.00 input / $15.00 output per 1M tokens, and Claude Opus 4.6 costs $15.00 input / $75.00 output per 1M tokens. That puts DeepSeek V3 in a different spending category for high-volume work, while frontier models still lead on multi-step agents and frontier-grade reasoning.

When does it make sense to use a frontier API instead of an open model API?

Three cases. Budget proprietary tiers like GPT-4o Mini at $0.15 input / $0.60 output per 1M tokens sit close to hosted open-model pricing with strong instruction following. Prompt caching and batch discounts can narrow the gap on repeatable workloads. And hard reasoning, agentic tool use, and high-stakes writing still favor frontier models like Claude Sonnet 4.6 at $3.00 input / $15.00 output per 1M tokens. The decision rule: open wins on volume at mid quality, frontier wins on the hardest tasks.

Sources

LLM API Pricing 2026 - 20+ Models Compared Per Token - data visualization and comparison chart
Visual summary for LLM API Pricing 2026 - 20+ Models Compared Per Token. Data verified by PE Collective.
RT
About the Author

Rome Thorndike is the founder of the Prompt Engineer Collective, a community of over 1,300 prompt engineering professionals, and author of The AI News Digest, a weekly newsletter with 2,700+ subscribers. Rome brings hands-on AI/ML experience from Microsoft, where he worked with Dynamics and Azure AI/ML solutions, and later led sales at Datajoy (acquired by Databricks).