Skip to main content
LLM API Pricing Compared: Cost per Million Tokens in 2026

LLM API Pricing Compared: Cost per Million Tokens in 2026

KU
· Founder & Chief Editor
• 8 min read•Updated •

A practitioner's guide to how LLM API pricing works, how to estimate a workload's monthly bill, and the levers that actually cut it.

Key takeaways

  • As of October 2026, LLM APIs range from $0.10 per million input tokens (gpt-6-luna, Claude Haiku 5.5) to $10 (gpt-6-astra, Claude Fable 5.1), with output priced about five times higher.
  • Monthly cost is tokens times rate times requests.
  • Prompt caching, batch APIs at 50% off, and routing easy traffic to a small model cut most bills hardest.

LLM APIs bill per million tokens, with output costing about 5x input. As of October 2026, small models such as gpt-6-luna and Claude Haiku 5.5 cost $0.10 input and $0.50 output, mid tiers $2/$10, and frontier models $4 to $10 input. Multiply tokens per request by rate and volume, then cut with caching, batch, and routing.

Verified against

Claude Opus 5.5, Claude Sonnet 5.5, Claude Haiku 5.5, gpt-6-astra, gpt-6.1-sol, gpt-6-luna, gemini-3.8-flash and deepseek-flash, against the Anthropic, OpenAI, Google and DeepSeek pricing pages. Checked October 2026.

The rate card, October 2026

Standard-tier list prices in USD per million tokens, short context, from each provider's pricing page. The batch column is the asynchronous price where the provider lists one.

ModelInputOutputCached inputBatch in / out
gpt-6-astra (OpenAI)$10.00$50.00$1.00$5.00 / $25.00
Claude Opus 5.5 (Anthropic)$4.00$20.00$0.20$2.00 / $10.00
gpt-6.1-sol (OpenAI)$2.00$10.00$0.10$1.00 / $5.00
Claude Sonnet 5.5 (Anthropic)$2.00$10.00$0.10$1.00 / $5.00
gemini-3.1-pro-preview (Google, up to 200K)$2.00$12.00$0.20$1.00 / $6.00
gemini-3.8-flash (Google)$0.75$3.75$0.075$0.375 / $1.875
deepseek-flash (DeepSeek, peak)$0.30$1.20$0.006n/a
Claude Haiku 5.5 (Anthropic, up to 100K)$0.10$0.50$0.01$0.05 / $0.25
gpt-6-luna (OpenAI)$0.10$0.50$0.01$0.05 / $0.25

All three big providers list batch at half the standard rate. Google has announced that gemini-3.8-flash doubles on January 1, 2027, and DeepSeek charges half the peak rate off-peak. Dated tables like this one age fast, so re-check the pricing pages before you budget.

How the meter actually runs

Every hosted LLM bills two buckets:

  • Input tokens: everything you send. System prompt, user message, retrieved documents, prior turns, and tool definitions all count.
  • Output tokens: everything the model generates, including thinking tokens on reasoning models.

Output costs more because it is generated one token at a time, while input is processed in a parallel pass. That asymmetry drives most optimization: a verbose prompt is annoying but cheap, a model that rambles for 800 tokens when 100 would do is where budgets bleed.

Three mechanics matter beyond base rates:

  • Prompt caching. Repeat a large prefix and the cached portion bills at a fraction of input. Anthropic charges 0.05x base on Opus 5.5 and Sonnet 5.5 and 0.1x on most other Claude models, plus a write premium (1.25x for the 5-minute cache). OpenAI and Google list cached rates per model; Google also charges hourly storage for explicit caches.
  • Batch APIs. Anthropic, OpenAI and Google all take 50% off for asynchronous jobs. Ideal for offline classification, enrichment and evals.
  • Context thresholds. Some models switch to a higher price above a prompt size: Claude Haiku 5.5 above 100K tokens, Gemini 3.1 Pro above 200K, OpenAI's older gpt-5.5 above 272K. A single oversized prompt pays the high rate for the whole request.

Estimating a workload's monthly bill

The formula is per request, then times volume. Here it is as a script you can run with any Python 3:

estimate.py
RATES = {  # USD per 1M tokens: (input, cached input, output), October 2026
    "opus-5.5": (4.00, 0.20, 20.00),
    "sonnet-5.5": (2.00, 0.10, 10.00),
    "gpt-6-luna": (0.10, 0.01, 0.50),
}

def monthly(model, fresh_in, cached_in, out, requests, batch=False):
    i, c, o = RATES[model]
    per_req = (fresh_in * i + cached_in * c + out * o) / 1_000_000
    return per_req * requests * (0.5 if batch else 1.0)

# Support assistant: 1,500 input tokens (1,200 of them a stable prefix), 400 out, 500k req/month
for m in RATES:
    print(f"{m:18} no cache ${monthly(m, 1500, 0, 400, 500_000):>8,.0f}"
          f"   cached ${monthly(m, 300, 1200, 400, 500_000):>8,.0f}")

Expected output:

Terminal
python3 estimate.py
opus-5.5           no cache $   7,000   cached $   4,720
sonnet-5.5         no cache $   3,500   cached $   2,360
gpt-6-luna         no cache $     175   cached $     121

Two things fall out. Caching cuts about a third here because output dominates, so max_tokens matters as much as caching. And the model choice is a 40x lever before any optimization at all. The estimate ignores cache-write premiums, which are small when the prefix is reused thousands of times.

The levers, in the order we pull them

  1. Instrument first. Log input, cached, and output tokens per request. Every provider returns usage in the response.
  2. Cap max_tokens and trim prompts. Free and immediate. Tighten RAG top-k; three relevant documents beat ten.
  3. Turn on prompt caching for any stable prefix, with that prefix first in the request.
  4. Route easy traffic to a small model. Classification and extraction rarely need a frontier model; the rate gap is 20x to 100x.
  5. Move asynchronous work to batch and halve it.
  6. Add semantic caching if users ask near-duplicate questions, so a hit costs an embedding lookup instead of a generation.
  7. Consider self-hosting last, only once volume is high and steady enough to keep GPUs busy.

Hidden costs the rate card leaves out

  • Retries. A request that times out after streaming half its answer is still billed. Aggressive retries on a flaky prompt can double spend.
  • Agent loops. Each step re-sends a growing context. A ten-step agent can cost many times the single call you estimated.
  • Tokenizer drift. Anthropic says Claude 4.7 and later produce about 30% more tokens for the same text than earlier Claude models, so migrating models changes your token count, not just your rate.
  • Embeddings and reranking. Every document embedded once, every query embedded forever, and rerankers billed per candidate.

When the bill or the API surprises you

  • Spend jumped after a model upgrade. Compare token counts per request before and after; a new tokenizer or default thinking can raise output tokens with the same prompts.
  • Cache hit rate near zero. The prefix is changing: a timestamp, request ID, or reordered tools at the top of the prompt. Move volatile content to the end.
  • Anthropic 429 rate_limit_error with no retry-after header. That is a spend cap, not a rate limit; retrying will not help until access resumes.
  • OpenAI insufficient_quota or credit_balance_exhausted. Billing, not load. Top up or raise the limit.

Where this breaks

Per-token comparisons assume equal tokens per task, and they are rarely equal: tokenizers differ, and a cheaper model that needs two attempts costs more than a pricier one that needs one. The rates above are list prices; committed-use deals, cloud marketplace pricing (Bedrock, Vertex) and regional endpoints differ. OpenAI adds a 10% uplift on regional processing for models released on or after March 5, 2026.

Questions people ask

What is the cheapest LLM API per million tokens?

As of October 2026, gpt-6-luna and Claude Haiku 5.5 both list $0.10 per million input tokens and $0.50 output, halved again through each batch API. OpenAI still lists the older gpt-5-nano at $0.05 input and $0.40 output. DeepSeek's deepseek-flash is $0.15 input off-peak. The cheapest per token is not always cheapest per task, so test quality first.

How do I calculate LLM API cost?

Multiply input tokens by the input rate and output tokens by the output rate, divide by one million, and add them for a per-request cost. Multiply by monthly requests. Split input into cached and fresh tokens if you use prompt caching, and halve anything that goes through a batch API. Log real token usage, because estimates are usually low.

Why are output tokens more expensive than input tokens?

Input tokens are processed together in one parallel pass, while output tokens are generated one at a time, each needing its own forward pass through the model. That makes output the compute-heavy part of a request. Across the October 2026 rate cards, output costs between four and six times input, so capping max_tokens is one of the cheapest optimizations available.

The call we'd make

Start on a hosted API and instrument token usage from day one. Cap max_tokens, cache the stable prefix, and put a small-model router in front before traffic scales, not after the invoice arrives. Pick the per-task model with our breakdown of which LLM API fits each use case, and the caching details in prompt caching for production LLM apps. Pay frontier rates only for hard requests and make everything else cheap by default.

Sources

Explore topics:LLMAI
React
Share this post
Cite this article
Plain text

Kiril Urbonas (2026). LLM API Pricing Compared: Cost per Million Tokens in 2026. DevOpsNess. Updated 2026-10-31. https://www.devopsness.com/blog/llm-api-pricing-comparison

Markdown

[LLM API Pricing Compared: Cost per Million Tokens in 2026](https://www.devopsness.com/blog/llm-api-pricing-comparison) (Kiril Urbonas, DevOpsNess, updated 2026-10-31)

KU

Kiril Urbonas

Founder & Chief Editor

611 articles
View all articles by Kiril Urbonas

You might have missed

Evergreen posts worth revisiting.