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.
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.
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.
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
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.
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.
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.
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 & model | Tier | Input / 1M | Output / 1M | Best for |
|---|---|---|---|---|
| GoogleGemini 2.5 Flash-Lite | Cheapest input | $0.10 | $0.40 | Classification, routing, high-volume tasks |
| DeepSeekDeepSeek V4-Flash | Cheapest output | $0.14 | $0.28 | Output-heavy generation, summarisation, drafting |
| xAIGrok 4.1 Fast | Budget alt. | $0.20 | $0.50 | Low-cost general tasks, real-time chat |
| OpenAIGPT-5.4 nano | Budget | $0.20 | $1.25 | Budget workloads, classification, tool-calling |
| GoogleGemini 3.1 Flash-Lite | Budget | $0.25 | $1.50 | High-volume tasks with newer-gen quality |
| DeepSeekDeepSeek V4-Pro | Cheap reasoning | $0.435 | $0.87 | Advanced reasoning & coding, 1M context — low cost |
| GoogleGemini 3 Flash | New gen | $0.50 | $3.00 | Fast multimodal, agentic workflows |
| AnthropicClaude Haiku 4.5 | Budget Claude | $1.00 | $5.00 | Fast tasks with strong instruction-following |
| OpenAIGPT-5.6 Luna | New (9 Jul) | $1.00 | $6.00 | Fast, high-volume GPT-5.6-tier work |
| OpenAIo4-mini | Best reasoning value | $1.10 | $4.40 | Chain-of-thought reasoning, coding, analysis |
| xAIGrok 4.3 | Cheapest flagship output | $1.25 | $2.50 | High-volume flagship-quality generation |
| MetaMuse Spark 1.1 | New (9 Jul) | $1.25 | $4.25 | Agentic coding, tool use — Meta's first paid model |
| OpenAIGPT-5.1 | General value | $1.25 | $10.00 | General-purpose reasoning and chat |
| GoogleGemini 2.5 Pro | Flagship | $1.25 | $10.00 | Long context, multimodal, research |
| GoogleGemini 3.5 Flash | New (May 2026) | $1.50 | $9.00 | Coding, agentic workflows, 1M context |
| xAIGrok 4.5 | New (8 Jul) | $2.00 | $6.00 | Coding, agents — Cursor-trained (500K context) |
| AnthropicClaude Sonnet 5 (intro) | New (30 Jun 2026) | $2.00 | $10.00 | Agentic coding, 1M context — intro price to 31 Aug |
| GoogleGemini 3.1 Pro | Flagship | $2.00 | $12.00 | Multimodal, coding, research (200K std tier) |
| OpenAIGPT-5.4 | Flagship | $2.50 | $15.00 | Advanced reasoning, agents, coding |
| OpenAIGPT-5.6 Terra | New (9 Jul) | $2.50 | $15.00 | GPT-5.5 quality at ~half the cost — value pick |
| AnthropicClaude Sonnet 4.6 | Mid-flagship | $3.00 | $15.00 | Complex instruction-following, writing |
| Moonshot AIKimi K3 | New (16 Jul) | $3.00 | $15.00 | Frontend coding, 1M context — open weights due 27 Jul |
| AnthropicClaude Opus 4.8 | Premium | $5.00 | $25.00 | Frontier reasoning, 1M context, long documents |
| OpenAIGPT-5.6 Sol | New (9 Jul) | $5.00 | $30.00 | Frontier coding, long-horizon agents, "ultra" mode |
| OpenAIGPT-5.5 | Premium | $5.00 | $30.00 | Top-tier reasoning, agents, coding, 1M context |
| AnthropicClaude Fable 5 | Top premium | $10.00 | $50.00 | Anthropic's most capable — complex reasoning & strategy |
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)
How many tokens is 1,000 words?
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).
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.
Use prompt caching
Anthropic, OpenAI, and Google offer prompt caching where repeated context is cached and served at 10–20% of normal input price.
Use batch APIs
Process requests asynchronously (typically within 24 hours) at 50% off standard pricing. Perfect for non-real-time workloads.
Downsize your model
Route simple tasks to cheaper models. Most tasks don't need the most expensive model.
Trim your output tokens
Output tokens cost 3–6× more than input. Set explicit length limits and use structured outputs where possible.
Optimise system prompts
A bloated 2,000-token system prompt across 100,000 daily calls adds 200M tokens of unnecessary input per day.
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.
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
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.
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.
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.
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.
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).
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.
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.
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.