The complete guide to AI API costs in 2026

Live pricing for GPT-5.6 Sol/Terra/Luna, Claude Sonnet 5, Claude Opus 4.8, Gemini 3.1 Pro, Grok 4.5, Kimi K3, DeepSeek V4-Flash and more. From understanding tokens to calculating your exact bill — updated 18 July 2026.

Contents

What's new in AI pricing — July 2026

This has been one of the busiest weeks of the year for model launches. Four moves changed the pricing map since our last update, with a fifth expected any day:

GPT-5.6 hits general availability (9 July 2026)

OpenAI's next-generation family is no longer a 20-partner preview — it's now generally available on the API and is the default model in ChatGPT. Pricing is unchanged from the preview: Sol $5/$30 (frontier — with an "ultra" reasoning mode that spawns subagents), Terra $2.50/$15 (matches GPT-5.5 quality at roughly half the per-token cost), and Luna $1/$6 (fast, high-volume). Terra is the one to watch for cost-sensitive production work.

Grok 4.5 (8 July 2026)

xAI's new flagship lands at $2/$6 per million tokens (500K context, $0.50 cached input). It's a Cursor-trained coding model that xAI positions against Opus-tier reasoning. Note the pricing steps up to $4/$12 above 200K tokens per request. It's pricier than the outgoing Grok 4.3 ($1.25/$2.50), so 4.3 remains the cheaper pick when you don't need 4.5's coding gains.

Kimi K3 (16 July 2026)

Moonshot AI's 2.8-trillion-parameter open MoE with a 1M-token context, priced at $3/$15 ($0.30 cached input). It topped the Frontend Code Arena on release — ahead of Claude Fable 5 and GPT-5.6 Sol — and full open weights are due by 27 July under a modified MIT licence, so self-hosting will drive the effective cost far lower.

Meta Muse Spark 1.1 (9 July 2026)

Meta's first paid API model, an agentic coder at $1.25/$4.25 that tops several tool-use benchmarks. A notable entry into the mid-tier value bracket alongside Grok 4.5 and GPT-5.6 Terra.

Coming next: Gemini 3.5 Pro

Google is reported to be targeting a mid-July general-availability launch for Gemini 3.5 Pro — a 2M-token context window and Deep Think reasoning are rumoured — but nothing is official yet, and no pricing has been confirmed. We'll add it to the calculator the moment Google publishes rates. For now, Gemini 3.1 Pro ($2/$12) remains the reference point.

Practical takeaway

For high-volume production, GPT-5.6 Terra ($2.50/$15) and Meta's Muse Spark 1.1 ($1.25/$4.25) are the value stories this week. For coding, benchmark Grok 4.5 and Kimi K3 against Claude Sonnet 5 — and if you can self-host, wait for the K3 open weights on 27 July. Output-heavy pipelines still favour DeepSeek V4-Flash ($0.14/$0.28). Hold on any Gemini migration until 3.5 Pro pricing is official.

What are tokens — and why do they matter?

When you send text to an AI model through an API, neither words nor characters are the fundamental unit of measurement. Instead, AI models work with tokens — fragments of text produced by a process called tokenisation.

A token is roughly 4 characters of English text, or approximately ¾ of a word. Common words like "the" or "and" are a single token, while longer or rarer words may split into two or more. Punctuation, spaces, and special characters each consume tokens too.

The quick brown fox jumped over the lazy dog
Each highlighted block ≈ 1 token
9 words ≈ 9–10 tokens

Tokens matter for one simple reason: every major AI provider bills you based on token count. OpenAI, Anthropic, Google, Mistral, and every other API provider charges per million tokens processed. The more tokens your prompts and responses consume, the higher your bill.

Input tokens vs output tokens

Input tokens (prompt tokens)

Everything you send to the model: your instructions, conversation history, documents, system prompts, and any context you include. Input tokens are always cheaper because the model is just reading and processing them.

Output tokens (completion tokens)

Everything the model generates in response. Output tokens cost significantly more — typically 3–6× the input price — because generating each token requires multiple passes through the model's neural network.

This asymmetry has a critical implication for your costs: long AI-generated responses are expensive. If you ask a model to write a 2,000-word article, those output tokens can cost as much as sending a full chapter of a book as input.

The AI pricing formula — how to calculate your bill

AI API pricing follows a straightforward formula. All providers quote prices in cost per million tokens (abbreviated as MTok or 1M tokens), so the calculation is consistent across providers.

Standard cost formula
total_cost = (input_tokens / 1,000,000) × input_price
             + (output_tokens / 1,000,000) × output_price
// Prices quoted per 1M tokens (e.g. $3.00/MTok)

Worked example: a customer support chatbot

Say you're running a chatbot on Claude Sonnet 5 at its introductory price ($2.00 input / $10.00 output per million tokens) and you process 10,000 conversations per day, with an average of 500 input tokens and 300 output tokens per conversation.

Monthly cost calculation
Daily input = 10,000 × 500 = 5,000,000 tokens
Daily output = 10,000 × 300 = 3,000,000 tokens
Daily input cost = (5M / 1M) × $2.00 = $10.00
Daily output cost = (3M / 1M) × $10.00 = $30.00
Monthly total = ($10 + $30) × 30 = $1,200 / month
// After 31 Aug 2026 (standard pricing $3/$15): $1,800/month
// On DeepSeek V4-Flash ($0.14/$0.28): about $46/month
Output tokens dominate your costs

In this example, output tokens cost 3× more than input tokens despite representing only 37% of total volume. For most real-world applications, reducing response length is the single fastest way to cut your AI bill.

Claude vs GPT vs Gemini vs Grok — which is cheaper in 2026?

The short answer: it depends entirely on which model tier you use and your input/output ratio. Every major provider offers budget, mid-range, flagship, and premium models — and the price differences within a single provider can be as large as 100× or more. In 2026 the divergence has widened: budget models keep getting cheaper (DeepSeek V4-Flash at $0.14/$0.28) while frontier flagships have risen (GPT-5.5 at $5/$30).

Provider & modelTierInput / 1MOutput / 1MBest for
GoogleGemini 2.5 Flash-LiteCheapest input$0.10$0.40Classification, routing, high-volume tasks
DeepSeekDeepSeek V4-FlashCheapest output$0.14$0.28Output-heavy generation, summarisation, drafting
xAIGrok 4.1 FastBudget alt.$0.20$0.50Low-cost general tasks, real-time chat
OpenAIGPT-5.4 nanoBudget$0.20$1.25Budget workloads, classification, tool-calling
GoogleGemini 3.1 Flash-LiteBudget$0.25$1.50High-volume tasks with newer-gen quality
DeepSeekDeepSeek V4-ProCheap reasoning$0.435$0.87Advanced reasoning & coding, 1M context — low cost
GoogleGemini 3 FlashNew gen$0.50$3.00Fast multimodal, agentic workflows
AnthropicClaude Haiku 4.5Budget Claude$1.00$5.00Fast tasks with strong instruction-following
OpenAIGPT-5.6 LunaNew (9 Jul)$1.00$6.00Fast, high-volume GPT-5.6-tier work
OpenAIo4-miniBest reasoning value$1.10$4.40Chain-of-thought reasoning, coding, analysis
xAIGrok 4.3Cheapest flagship output$1.25$2.50High-volume flagship-quality generation
MetaMuse Spark 1.1New (9 Jul)$1.25$4.25Agentic coding, tool use — Meta's first paid model
OpenAIGPT-5.1General value$1.25$10.00General-purpose reasoning and chat
GoogleGemini 2.5 ProFlagship$1.25$10.00Long context, multimodal, research
GoogleGemini 3.5 FlashNew (May 2026)$1.50$9.00Coding, agentic workflows, 1M context
xAIGrok 4.5New (8 Jul)$2.00$6.00Coding, agents — Cursor-trained (500K context)
AnthropicClaude Sonnet 5 (intro)New (30 Jun 2026)$2.00$10.00Agentic coding, 1M context — intro price to 31 Aug
GoogleGemini 3.1 ProFlagship$2.00$12.00Multimodal, coding, research (200K std tier)
OpenAIGPT-5.4Flagship$2.50$15.00Advanced reasoning, agents, coding
OpenAIGPT-5.6 TerraNew (9 Jul)$2.50$15.00GPT-5.5 quality at ~half the cost — value pick
AnthropicClaude Sonnet 4.6Mid-flagship$3.00$15.00Complex instruction-following, writing
Moonshot AIKimi K3New (16 Jul)$3.00$15.00Frontend coding, 1M context — open weights due 27 Jul
AnthropicClaude Opus 4.8Premium$5.00$25.00Frontier reasoning, 1M context, long documents
OpenAIGPT-5.6 SolNew (9 Jul)$5.00$30.00Frontier coding, long-horizon agents, "ultra" mode
OpenAIGPT-5.5Premium$5.00$30.00Top-tier reasoning, agents, coding, 1M context
AnthropicClaude Fable 5Top premium$10.00$50.00Anthropic's most capable — complex reasoning & strategy
Prices are falling — and rising — fast

The 2026 market has diverged. Budget and open-weight models keep getting cheaper (DeepSeek V4-Flash at $0.14/$0.28 is a full order of magnitude below early-2025 flagship prices). Meanwhile, top-tier frontier models are getting more expensive — GPT-5.6 Sol and GPT-5.5 sit at $5/$30, and Claude Fable 5 tops the table at $10/$50. Match model to task: use flagships only for the ~5% of requests that truly need them.

What is the cheapest AI API in July 2026?

It depends on your input/output ratio. Google Gemini 2.5 Flash-Lite has the cheapest input at $0.10/M tokens and matches on output at $0.40/M. DeepSeek V4-Flash wins on output at $0.28/M — the lowest generation cost from any major provider — with $0.14/M input. If your workload is output-heavy (drafting, summarising, code generation), DeepSeek V4-Flash produces the lowest total bill. If input-heavy (RAG, long documents), Gemini 2.5 Flash-Lite wins. Either way, you could process ~10 million words of English text — about 20 full novels — for roughly $13 in input costs.

Cheapest models by use case (July 2026)

Use case
Recommended model
Approx. price (I/O per MTok)
Simple classification & routing
Gemini 2.5 Flash-Lite
$0.10 / $0.40
High-volume summarisation & drafting
DeepSeek V4-Flash
$0.14 / $0.28
General chatbots
GPT-5.6 Luna or Grok 4.3
$1.00–$1.25 / $2.50–$6.00
Reasoning / chain-of-thought
o4-mini
$1.10 / $4.40
Agentic coding
Claude Sonnet 5 or Gemini 3.5 Flash
$1.50–$2.00 / $9.00–$10.00
Complex reasoning (flagship)
GPT-5.4 or Gemini 3.1 Pro
$2.00–$2.50 / $12.00–$15.00
Long document analysis
Claude Opus 4.8 (1M context)
$5.00 / $25.00
Writing & content
Claude Sonnet 5 or Sonnet 4.6
$2.00–$3.00 / $10.00–$15.00
Frontier problems / research
GPT-5.5 or Claude Opus 4.8
$5.00 / $25.00–$30.00

How many tokens is 1,000 words?

The rule of thumb for English text

1,000 words ≈ 1,300 to 1,500 tokens. The most widely used estimate is 1,333 tokens per 1,000 words (multiply word count by 1.33).

Content
Word count
Approx. tokens
Short tweet
~15 words
~20
Email
~200 words
~260–300
Blog post
~1,000 words
~1,300–1,500
Novel chapter
~10,000 words
~13,000–15,000
Full novel
~90,000 words
~117,000–135,000

Cost optimisation strategies — cut your AI bill by up to 90%

AI API costs are almost never fixed. With the right architecture, most applications can reduce token usage by 50–90% without sacrificing quality.

Save 50–90%
01

Use prompt caching

Anthropic, OpenAI, and Google offer prompt caching where repeated context is cached and served at 10–20% of normal input price.

Save 50%
02

Use batch APIs

Process requests asynchronously (typically within 24 hours) at 50% off standard pricing. Perfect for non-real-time workloads.

Save 30–70%
03

Downsize your model

Route simple tasks to cheaper models. Most tasks don't need the most expensive model.

Save 20–50%
04

Trim your output tokens

Output tokens cost 3–6× more than input. Set explicit length limits and use structured outputs where possible.

Save 20–40%
05

Optimise system prompts

A bloated 2,000-token system prompt across 100,000 daily calls adds 200M tokens of unnecessary input per day.

Save 30–60%
06

Use RAG over large context

Send only the most relevant snippets rather than entire knowledge bases. A fraction of the cost with similar accuracy.

Prompt caching in depth

Prompt caching is the single biggest cost lever available today. If a portion of your prompt remains unchanged between requests — a system prompt, a large document — the provider caches the processed representation and charges you a fraction of the normal price on subsequent requests.

Cache pricing at a glance

Anthropic: Cache write 1.25× input price; cache read just 0.1× (90% savings on warm cache).

OpenAI: Cached input tokens cost 50% of normal rate.

Google: Context caching priced per storage hour plus reduced per-token rate.

Frequently asked questions

Is Claude, GPT, or Gemini cheaper in 2026?

At the budget tier, Gemini 2.5 Flash-Lite is cheapest on input ($0.10/M) while DeepSeek V4-Flash is cheapest on output ($0.28/M). At the flagship tier, Grok 4.3 at $1.25/$2.50 and GPT-5.6 Terra at $2.50/$15.00 are the best price-to-performance picks. Claude Sonnet 5's intro pricing of $2.00/$10.00 (through 31 Aug 2026) beats Sonnet 4.6 substantially. Claude Opus 4.8 at $5.00/$25.00 and GPT-5.5 at $5.00/$30.00 are the premium options.

What is the cheapest AI API in July 2026?

Google Gemini 2.5 Flash-Lite has the cheapest input at $0.10/M. DeepSeek V4-Flash has the cheapest output at $0.28/M. xAI's Grok 4.1 Fast ($0.20/$0.50) and OpenAI's GPT-5.4 nano ($0.20/$1.25) are close alternatives. For an output-heavy workload, DeepSeek is the winner overall.

What are the newest AI models released in July 2026?

GPT-5.6 Sol / Terra / Luna (GA 9 Jul 2026) — now the default in ChatGPT; $5/$30, $2.50/$15, $1/$6 respectively. Grok 4.5 (8 Jul 2026) — xAI's Cursor-trained coding flagship at $2/$6, 500K context. Kimi K3 (16 Jul 2026) — Moonshot's 2.8T open MoE, 1M context, $3/$15, open weights due 27 Jul. Muse Spark 1.1 (9 Jul 2026) — Meta's first paid model, an agentic coder at $1.25/$4.25. Claude Sonnet 5 (30 Jun 2026) remains at $2/$10 intro through 31 Aug. Gemini 3.5 Pro is reported imminent but not yet officially released.

How many tokens is 1,000 words?

For standard English prose, 1,000 words ≈ 1,300–1,500 tokens (multiply words by 1.33). Code tokenises more efficiently; non-Latin languages require more tokens per semantic unit. Note that Claude Sonnet 5 uses an updated tokenizer that can produce up to 1.35× more tokens on the same text.

Why are output tokens more expensive than input tokens?

Generating tokens requires significantly more compute than reading them. Output performs a separate forward pass for every single token produced. Most providers price output tokens at 3–6× the input rate. GPT-5.5 has the widest gap at 6× ($5/$30), while Grok 4.3 has the smallest at 2× ($1.25/$2.50).

Do AI API prices keep changing?

Yes — and the direction is no longer just downward. Budget and open-source model prices continue to fall (DeepSeek V4-Flash at $0.14/$0.28, Kimi K3's open-weights release). But frontier flagship prices are rising: GPT-5.6 Sol and GPT-5.5 sit at $5/$30, and Claude Fable 5 reaches $10/$50. Build estimates for both directions.

Is there a free AI API I can use?

Yes. Google's Gemini API offers a generous free tier sufficient for prototyping and low-volume production. OpenAI offers free credits to new developers. xAI offers up to $175/month in promotional credits through their data-sharing programme.

What is a context window?

The maximum number of tokens a model can process in a single request. Claude Opus 4.8, Claude Sonnet 5, GPT-5.5 and Gemini 3.1 Pro all support 1M tokens; Grok 4.20 goes to 2M. Note: Gemini 3.1 Pro applies a higher rate ($4/$18) above 200K tokens per request.