/

/

/

OpenAI API Pricing Breakdown With Claude And Gemini LLMs

Share

OpenAI API Pricing Breakdown With Claude And Gemini LLMs

OpenAI API Pricing Breakdown With Claude And Gemini LLMs

OpenAI API Pricing Breakdown With Claude And Gemini LLMs

Mem0 logo
Updated on Jul 31, 2026

·

20 min read

Perplexity Pricing
Perplexity Pricing

On this page

As of October 2026, mainstream LLM API pricing starts at $0.10 per million input tokens. Claude Haiku 5.5 and GPT-6 Luna share that floor, both at $0.10 input and $0.50 output. GPT-5.6 Luna sits just above at $0.20 and $1.20. At the higher end, flagship reasoning models cost far more: GPT-5.6 Sol is $4 input and $20 output on promotional pricing, and Claude Opus 5.5 matches it at $4 and $20. Google's Gemini 3.8 Flash sits between the budget and flagship tiers at $0.75 and $3.75 through December 31, 2026. In practice, the cheapest API depends on the model tier, the output volume, the context length, caching, and batch usage.

Every developer building with LLMs learns the same lesson sooner or later: your first cost estimate is wrong. Not because the per-token prices are hard to find, but because the number of tokens you actually send per request, once you add conversation history, context, retrieved documents, and system prompts, is much larger than the number of tokens in the user's message.

This guide breaks down current API pricing for OpenAI, Anthropic, Google, and DeepSeek, covers the cost levers that move the needle in production, and shows how your memory architecture decides whether your LLM costs are sustainable.

If you want to run the numbers on your own usage, Mem0's LLM cost calculator lets you model token costs across models and see the impact of memory-based context management on your actual bill.

How Does LLM API Pricing Work?

LLM providers price usage by tokens, and they charge separately for the tokens you send and the tokens the model generates. Input tokens cover your prompt, system instructions, conversation history, and any retrieved context. Output tokens cover the text the model generates in reply. Rates are quoted per million tokens, and output is almost always more expensive than input, often five to six times more, because generation costs more compute than reading.

Six things change what you actually pay:

  • Model tier and capability: A flagship reasoning model can cost 100 times more per token than a budget model.

  • Input against output usage: Two workloads that use the same total tokens can cost very different amounts, depending on the split.

  • Prompt caching: Repeated context can be cached and read back at a fraction of the input price, usually a 90% discount.

  • Batch processing: Asynchronous work usually gets 50% off.

  • Context length: Several providers charge more above a threshold, such as 200K or 272K tokens.

  • Provider-specific policies: Promotional rates, off-peak discounts, and regional pricing all apply.

The input and output split matters more than most teams expect. A RAG or agent system sends large prompts and gets short answers back, so it is input-heavy, and cached-input pricing matters most. A coding or reasoning application generates long responses, so it is output-heavy, and the output rate dominates the bill.

LLM API Cost Comparison

LLM API costs vary widely across providers and model tiers. Comparing only the advertised input price can mislead you, because output rates, caching, batch discounts, and workload type all change the final cost. The table below compares OpenAI, Claude, Gemini, and DeepSeek across broadly similar pricing tiers.

All rates per 1M tokens, USD as of October 2026.


Tier

Model

Context

Input / 1M

Output / 1M

Cached Input

Batch Discount

Best for

Budget

Claude Haiku 5.5

200K

$0.10

$0.50

$0.01

50%

High-volume simple tasks

Budget

GPT-6 Luna

1.05M

$0.10

$0.50

90% off

50%

Classification, extraction

Budget

GPT-5.6 Luna

1.05M

$0.20

$1.20

$0.02

50%

Routing, summarizing, drafting

Budget

DeepSeek V4.1 Flash

1M

$0.15 off-peak

$0.60 off-peak

$0.003

None

Cost-sensitive high volume

Mid-tier

Gemini 3.8 Flash

1M

$0.75

$3.75

$0.075

50%

Volume work needing more capability

Mid-tier

Claude Sonnet 5.5

1M

$2.00

$10.00

$0.20

50%

Production agents

Mid-tier

GPT-6.1 Sol

1.05M

$2.00

$10.00

90% off

50%

Production agents

Mid-tier

Gemini 3.1 Pro

1M

$2.00 (≤200K)

$12.00

$0.20

50%

Coding, reasoning, long context

Flagship

Claude Opus 5.5

1M

$4.00

$20.00

$0.20

50%

Complex reasoning

Flagship

GPT-5.6 Sol

1.05M

$4.00

$20.00

$0.40

50%

Complex reasoning, coding

Flagship

Claude Fable 5.1

1M

$10.00

$50.00

$0.25

50%

Hardest coding and knowledge work

Flagship

GPT-6 Astra

1.05M

$10.00

$50.00

90% off

50%

Frontier reasoning

What the comparison shows

Budget models have the lowest token costs and suit high-volume, simpler work: classification, extraction, routing, and lightweight chat. The floor moved twice in the last three months, so check it before you commit.

Mid-tier models usually give the best balance of cost and capability for production applications, which includes agents, coding assistants, and RAG systems. Most teams should start here and move only if evaluations justify it.

Flagship models cost much more, especially on output tokens, but they are built for work where stronger reasoning or higher-quality generation pays for the difference.

The cheapest model on paper is not always the cheapest in production. An input-heavy RAG system benefits most from lower input or cached-token pricing. A coding or reasoning application that generates long responses is more sensitive to the output rate. Batch discounts and prompt caching can also change the effective cost by a large margin.

For that reason, compare LLM API cost by workload and model tier, not by provider alone.

What Is the Cheapest LLM API?

Claude Haiku 5.5 and GPT-6 Luna are the cheapest current-generation models from the major frontier providers, both at $0.10 per million input tokens and $0.50 per million output tokens. Claude Haiku 5.5 holds that rate for prompts up to 100,000 tokens, after which it rises to $0.50 and $2.50. Verified October 10, 2026.

The answer changes by what "cheapest" means to you:

  • Cheapest input: Claude Haiku 5.5 and GPT-6 Luna tie at $0.10 per million. Among open-weight-adjacent options, DeepSeek V4.1 Flash is $0.15 off-peak, and its cache-hit rate of $0.003 per million is the lowest published input rate of any model here.

  • Cheapest output: Claude Haiku 5.5 and GPT-6 Luna tie again at $0.50 per million. This matters more than the input rate for any workload that generates long responses.

  • Cheapest by provider:

    • OpenAI: GPT-6 Luna at $0.10/$0.50.

    • Anthropic: Claude Haiku 5.5 at $0.10/$0.50 under 100K tokens.

    • Google: Gemini 2.5 Flash-Lite at $0.10/$0.40, though Gemini 3.1 Flash-Lite at $0.25/$1.50 is the current-generation option.

  • Cheapest for batch and long-context work: All three major providers give 50% off for batch processing, so the ranking does not change. For long context, the picture does change: Claude Sonnet 5.5 and Opus 5.5 charge the standard rate across the full 1M-token window, while Gemini Pro and GPT-5.6 both add a surcharge above a threshold. See "When Long-Context Pricing Matters" below.

  • Third-party and open-weight options are a separate category: DeepSeek is not an OpenAI, Anthropic, or Google product, and it carries different governance, data residency, and availability conditions. Its off-peak pricing is also time-bound: the same request costs double during peak hours, which are 01:00 to 04:00 and 06:00 to 10:00 UTC on weekdays.

One caveat: The lowest price per token is not the lowest cost per completed task. A cheaper model can need more retries, produce weaker output that needs human review, or hit a shorter context limit that forces you to split a request. Weigh these against the rate:

  • Weaker reasoning on complex tasks

  • Shorter context limits, such as Claude Haiku 5.5's 100K price threshold

  • Higher retry rates on structured output

  • Governance and data residency rules, which matter most for non-US providers

  • Missing caching or batch support

The cheapest model can change after a provider price cut. Verify the latest rates before you make a production decision. The floor moved from $0.20 to $0.10 in the first week of October 2026.

OpenAI API Pricing

OpenAI now runs two generations side by side. GPT-5.6 has three tiers, and the newer GPT-6 family sits above it.

Model

Input / 1M

Cached Input

Output / 1M

Context

GPT-6 Astra

$10.00

90% off

$50.00

1.05M

GPT-6.1 Sol

$2.00

90% off

$10.00

1.05M

GPT-6 Luna

$0.10

90% off

$0.50

1.05M

GPT-5.6 Sol

$4.00

$0.40

$20.00

1.05M

GPT-5.6 Terra

$2.00

$0.20

$12.00

1.05M

GPT-5.6 Luna

$0.20

$0.02

$1.20

1.05M

Promotional pricing: GPT-5.6 Sol's $4/$20 rate is promotional. OpenAI's own wording is that it "is available at least through November 21, 2026", which is a floor, not an expiry. The standard rate is $5/$30.

Long context: Prices double above 272,000 input tokens. GPT-5.6 Sol goes to $8 input and $30 output in that band.

Batch API: 50% off. Prompt caching: cached reads at 90% off the input rate.

For the full OpenAI breakdown, see Mem0's OpenAI API pricing guide.

Claude API Pricing

Anthropic's lineup changed twice in recent months. Opus 5.5 arrived on September 22, 2026 and undercut Opus 5. Haiku 5.5 arrived on October 7, 2026 at a tenth of Haiku 4.5's price.

Model

Input / 1M

Cached Input

Output / 1M

Context

Claude Fable 5.1

$10.00

$0.25

$50.00

1M

Claude Opus 5.5

$4.00

$0.20

$20.00

1M

Claude Opus 5

$5.00

$0.50

$25.00

1M

Claude Sonnet 5.5

$2.00

$0.20

$10.00

1M

Claude Sonnet 5

$2.00

$0.20

$10.00

1M

Claude Haiku 5.5 (≤100K)

$0.10

$0.01

$0.50

200K

Claude Haiku 5.5 (>100K)

$0.50

$0.05

$2.50

200K

Claude Haiku 4.5

$1.00

$0.10

$5.00

200K

Sonnet 5's price is permanent: Anthropic had scheduled an increase to $3/$15 for September 1, 2026, then cancelled it. The $2/$10 rate is now standard with no end date.

No long-context surcharge: Sonnet 5, Sonnet 5.5, Opus 5, Opus 5.5, and Fable 5.1 all charge the standard rate across the full 1M-token window. This is a real change from the older Sonnet 4.6, which doubled above 200K.

Batch API: 50% off. Prompt caching: cache writes at 1.25x the input rate for a 5-minute cache, 2x for a 1-hour cache. Cache reads run from 5% to 10% of the input price, depending on the model.

For a deeper breakdown, see Mem0's Anthropic Claude pricing guide.

Gemini API Pricing

Model

Input / 1M

Cached Input

Output / 1M

Context

Gemini 3.1 Pro (≤200K)

$2.00

$0.20

$12.00

1M

Gemini 3.1 Pro (>200K)

$4.00

$0.40

$18.00

1M

Gemini 3.8 Flash

$0.75

$0.075

$3.75

1M

Gemini 3.1 Flash-Lite

$0.25

—

$1.50

1M

Gemini 2.5 Flash-Lite

$0.10

—

$0.40

1M

Gemini 3.8 Flash's $0.75/$3.75 rate is introductory and runs through December 31, 2026. On January 1, 2027 it doubles to $1.50/$7.50. Gemini 3.7 Flash and 3.6 Flash share the same rate and the same cliff. If you plan a 2027 budget on Flash, use the post-January numbers.

Long context: Gemini 3.1 Pro doubles its input rate and raises output by half above 200K tokens.

Batch API: 50% off. Context caching: up to 90% off cached input.

For the full Gemini breakdown, see Mem0's Gemini API pricing guide.

DeepSeek API Pricing

DeepSeek prices differently from the others. Rates change by time of day, and cache hits are priced far below cache misses.

Model

Period

Input (cache miss) / 1M

Input (cache hit) / 1M

Output / 1M

Context

DeepSeek V4.1 Flash

Off-peak

$0.15

$0.003

$0.60

1M

DeepSeek V4.1 Flash

Peak

$0.30

$0.006

$1.20

1M

DeepSeek V4 Pro

Off-peak

$0.66

$0.022

$1.98

1M

DeepSeek V4 Pro

Peak

$1.32

$0.044

$3.96

1M

Peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday, excluding Chinese public holidays. All other hours bill at half those rates. If your work can be scheduled, the off-peak window is most of the week.

The cache-hit rate is the standout number. At $0.003 per million, a stable agent prefix costs almost nothing to re-send. This is the lowest published input rate in this comparison by a wide margin.

For the full DeepSeek breakdown, see Mem0's DeepSeek API pricing guide.

How to Calculate LLM API Costs for Your Workload

Real cost depends on five things: input tokens per request, output tokens per request, the number of requests, the model's rates, and any caching or batch discount you qualify for.

For standard text-token usage, the arithmetic is simple:

Monthly cost = [(input tokens x input rate) + (output tokens x output rate)] x monthly requests

Normalize every rate to the provider's quoted unit, which is almost always per 1M tokens. This is not a universal formula. Long-context surcharges, cache-write fees, tool usage, and regional pricing can all change the result.

A worked example

The same workload, priced across tiers. The example uses base rates, with no caching or batch discount applied.

  • Daily requests: 10,000

  • Average input per request: 4,000 tokens

  • Average output per request: 500 tokens

  • Monthly input: 1,200M tokens

  • Monthly output: 150M tokens

Model

Provider

Monthly cost

Cost per 1K requests

Claude Haiku 5.5

Anthropic

$195

$0.65

DeepSeek V4.1 Flash (off-peak)

DeepSeek, external

$270

$0.90

GPT-5.6 Luna

OpenAI

$420

$1.40

Gemini 3.8 Flash

Google

$1,463

$4.88

Claude Sonnet 5.5

Anthropic

$3,900

$13.00

Gemini 3.1 Pro

Google

$4,200

$14.00

Claude Opus 5.5

Anthropic

$7,800

$26.00

GPT-5.6 Sol

OpenAI

$7,800

$26.00

Claude Fable 5.1

Anthropic

$19,500

$65.00

The most expensive option on this list costs 100 times the cheapest, for identical traffic. That spread is the reason routing matters: work that does not need frontier reasoning, such as classification, routing, and extraction, can run on a budget model and free the budget for work that does.

Routing is not the whole story. Capability, retry rates, latency, context size, and quality requirements all affect the real cost per completed task. A flagship model that succeeds first time can cost less than a budget model that needs three attempts and a human review.

The same traffic pattern can produce very different monthly costs, depending on model choice. For production systems, the most cost-efficient setup usually routes simpler tasks to lower-cost models and reserves more expensive models for work where evaluations show a measurable quality gain.

Mem0's LLM cost calculator at llmcost.app lets you model this across models. You can enter your expected volumes, adjust token counts for your workload, and see the cost difference between full-context and memory-based context management side by side.

For teams already using Mem0 in production, the long-term memory guide covers the memory scoping patterns that keep token counts low across sessions. The LLM chat history summarization guide covers the choice between summarization, truncation, and memory extraction, and the cost of each.

The model you choose matters. The number of tokens you send matters more.

Which LLM Pricing Tier Should You Choose?

The right tier depends on task complexity, quality requirements, context size, latency, and your cost constraints. Four rules cover most decisions.

1. Start with the lowest-cost model that meets your quality threshold. Run evaluations on your actual workload, not on a benchmark. Move up a tier only when the cheaper model fails a measurable quality, reliability, or reasoning requirement.

2. Treat output-heavy workloads separately. Output costs five to six times more than input on most models. A workload that generates long responses is affected far more by the output rate than by the input rate. Response-length controls and concise output formats reduce this directly.

3. Use pricing multipliers as tie-breakers. When two models are close on quality, compare long-context pricing, caching eligibility, batch discounts, context-window limits, and latency needs. These often decide the result.

4. Re-evaluate routing regularly. Provider pricing and model lineups change often. Two price floors moved in the first week of October 2026 alone. Re-run cost and quality evaluations after a major price or model update.

Workload

Recommended starting tier

Classification, extraction, routing

Budget

General production agents, RAG

Mid-tier

Complex reasoning, coding, high-stakes generation

Flagship

The cheapest tier and the best tier are not the same thing. Choose on cost per successful task, not on price per token.

Head-to-Head: The Same Workload Across Providers

Numbers in isolation are less useful than numbers applied to a real workload. Take a mid-complexity conversational agent: a 500-token system prompt, 3,000 tokens of conversation history each turn, a 100-token user message, and a 300-token response.

Total input per request: 3,600 tokens. Total output: 300 tokens.

Cost per 1,000 requests:

Model

Input cost

Output cost

Total

Claude Haiku 5.5

$0.36

$0.15

$0.51

GPT-6 Luna

$0.36

$0.15

$0.51

DeepSeek V4.1 Flash (off-peak)

$0.54

$0.18

$0.72

GPT-5.6 Luna

$0.72

$0.36

$1.08

Gemini 3.8 Flash

$2.70

$1.13

$3.83

Claude Sonnet 5.5

$7.20

$3.00

$10.20

GPT-6.1 Sol

$7.20

$3.00

$10.20

Gemini 3.1 Pro

$7.20

$3.60

$10.80

Claude Opus 5.5

$14.40

$6.00

$20.40

GPT-5.6 Sol

$14.40

$6.00

$20.40

Claude Fable 5.1

$36.00

$15.00

$51.00

GPT-6 Astra

$36.00

$15.00

$51.00

Scale this to 100,000 requests per month and Claude Fable 5.1 costs $5,100. Claude Haiku 5.5 costs $51. The variance between the cheapest and most expensive model is exactly 100x for the same workload.

This is why model selection matters, and why the pattern of sending full conversation history on every request makes the cost problem worse.

The Hidden Cost Driver: How Many Tokens You Send Per Request

The table above assumes 3,000 tokens of history per request. Most teams think that is reasonable. At 10 conversation turns of average length, it is.

But a customer support agent with an ongoing case might carry 40 to 50 turns of history. A coding assistant might send 15,000 tokens of file context with each message. A research assistant with retrieved documents might routinely send 20,000 to 80,000 token inputs.

At those volumes, the input token cost stops being a line item and becomes the budget.

Sending everything, every time, is also the most computationally expensive path at inference. Mem0's research on the LoCoMo benchmark measured this trade-off: full-context approaches consume roughly 26,000 tokens per conversation. Mem0's selective retrieval consumes roughly 1,800 tokens, a 93% reduction.

Here is what that looks like on a monthly invoice at 100,000 conversations:


Provider and model

Full-context monthly input cost

With Mem0 (1,800 tokens)

Monthly savings

Gemini 3.8 Flash

$1,950

$135

$1,815

Claude Sonnet 5.5

$5,200

$360

$4,840

Gemini 3.1 Pro

$5,200

$360

$4,840

Claude Opus 5.5

$10,400

$720

$9,680

GPT-5.6 Sol

$10,400

$720

$9,680

Claude Fable 5.1

$26,000

$1,800

$24,200

These figures cover input tokens only. Output costs add to them, and the latency of large inputs adds engineering cost on top.

The Three Cost Levers That Actually Matter

Once you have the right model, three levers drive most of the remaining variation.

1. Context discipline: The cheapest optimization available is to send fewer tokens per request. In practice: do not send full conversation history when a compact memory retrieval serves the same purpose, do not attach whole documents when only a section applies, and do not repeat system context that could be cached. The context engineering guide covers what belongs in the context window against what belongs in a memory layer.

2. Caching: Prompt caching is available across all four providers here and cuts repeated input costs by up to 90%. Any application that sends the same system prompt, document set, or conversation prefix more than once should use it. The mechanics differ: Anthropic supports 5-minute and 1-hour cache windows, OpenAI and Google manage caching their own way, and DeepSeek prices cache hits at $0.003 per million off-peak.

3. Batch processing: OpenAI, Anthropic, and Google all give 50% off asynchronous batch work. If any part of your application does not need a real-time response, such as classification, memory extraction, document processing, or scheduled summarization, the Batch API halves the cost of those calls.

When Long-Context Pricing Matters

The 1M-token context windows now standard across these providers are a real capability expansion for full codebase analysis, legal document review, and whole-paper processing.

For those cases, the cost math has changed since early 2026, and it changed in Anthropic's favor. At 500,000 input tokens:

  • Claude Sonnet 5.5: $2.00/M across the full window x 0.5M = $1.00 per request

  • Claude Opus 5.5: $4.00/M across the full window x 0.5M = $2.00 per request

  • Gemini 3.1 Pro: $4.00/M (above the 200K threshold) x 0.5M = $2.00 per request

  • GPT-5.6 Sol: $8.00/M (above the 272K threshold) x 0.5M = $4.00 per request

  • GPT-5.6 Luna: $0.40/M (above threshold) x 0.5M = $0.20 per request

The pattern to note: Claude's current models charge a flat rate across the full 1M window, while both Gemini Pro and GPT-5.6 add a surcharge above a threshold. For genuinely long-context work, that flat rate is now a real advantage, which was not true of the older Sonnet 4.6.

For agents and conversational AI, though, sending 500K tokens to carry conversation history is still the wrong tool. For those applications, the 26,000-against-1,800-token comparison is the more relevant figure.

A 2026 research paper, "Beyond the Context Window: A Cost-Performance Analysis of Fact-Based Memory vs. Long-Context LLMs for Persistent Agents" (arXiv:2603.04814), addresses this directly: fact-based memory retrieval is not only cheaper, it holds competitive accuracy at a fraction of the context-window cost for persistent agent workloads.

Frequently Asked Questions

Q. Which LLM API is the cheapest?

Claude Haiku 5.5 and GPT-6 Luna tie at $0.10 per million input tokens and $0.50 per million output tokens, verified October 10, 2026. Claude Haiku 5.5 holds that rate for prompts up to 100K tokens. Among external providers, DeepSeek V4.1 Flash is $0.15 input off-peak, with cache hits at $0.003 per million.

Q. Is Claude cheaper than OpenAI?

It depends on the tier. At the budget end they are level: Claude Haiku 5.5 and GPT-6 Luna both cost $0.10/$0.50. At mid-tier they are also level: Claude Sonnet 5.5 and GPT-6.1 Sol both cost $2/$10. At flagship, Claude Opus 5.5 and GPT-5.6 Sol both cost $4/$20. The clearer difference is long context, where Claude charges a flat rate across its full 1M window and OpenAI doubles above 272K tokens.

Q. Is Gemini cheaper than OpenAI and Claude?

Not at the budget tier. Gemini 3.8 Flash at $0.75/$3.75 costs more than GPT-5.6 Luna at $0.20/$1.20 and much more than Claude Haiku 5.5 at $0.10/$0.50. Gemini is competitive at mid-tier, where Gemini 3.1 Pro at $2/$12 sits close to Claude Sonnet 5.5 at $2/$10. Note that Gemini 3.8 Flash's rate doubles on January 1, 2027.

Q. How much does 1 million LLM tokens cost?

Between $0.10 and $50, depending entirely on the model and whether the tokens are input or output. One million input tokens cost $0.10 on Claude Haiku 5.5 and $10 on Claude Fable 5.1 or GPT-6 Astra. One million output tokens cost $0.50 on the cheapest models and $50 on the most expensive. Output almost always costs five to six times more than input on the same model.

Q. How does context length affect LLM API cost?

In two ways. First, longer prompts mean more input tokens, and you pay for every one on every request. Second, several providers charge a higher rate above a threshold: Gemini 3.1 Pro doubles its input rate above 200K tokens, and GPT-5.6 doubles above 272K. Claude's current models (Sonnet 5.5, Opus 5.5, Fable 5.1) charge the standard rate across the full 1M window, with no surcharge.

Q. How can I reduce LLM API costs?

Four levers, in order of impact. Send fewer tokens per request, usually by replacing full conversation history with selective memory retrieval. Use prompt caching for any context you send more than once, which cuts those input costs by up to 90%. Use the Batch API for anything that does not need a real-time response, for 50% off. Route simpler tasks to cheaper models and keep flagship models for work where evaluations show a measurable gain.

External references:

Start building with memory

Wire persistent memory into your own agent in about 15 minutes. Free tier, no credit card.

Share on:

Mem0 logo

Engineering Team

Start building with memory

Free tier, no card