How AI API pricing actually works, current rates across OpenAI, Anthropic, and Google, and five ways to cut your monthly AI bill.
AI API bills are usually more predictable than they first appear — once you understand how providers actually charge for tokens. This guide walks through the mechanics, the current rates across OpenAI, Anthropic, and Google, and the handful of levers that make the biggest difference to your monthly bill.
What determines AI API pricing
Every major provider bills per token, not per request. A token is roughly four characters of English text, so 1,000 tokens works out to about 750 words. Two things set the price for a given model: which tier it sits in (budget, mid, or flagship), and whether the tokens are input or output.
Input vs. output tokens: why the split matters
Input tokens are everything you send the model: your prompt, system instructions, conversation history, retrieved context, and tool definitions. Output tokens are what the model generates back.
Output tokens cost significantly more than input tokens on every provider — typically four to six times as much. Anthropic keeps a consistent 5x ratio across its whole lineup, which makes back-of-envelope budgeting easy. OpenAI’s ratio varies more by tier, from about 4x on nano models up to 6x on the flagship. Google’s Gemini models generally sit in the 6-8x range.
The practical takeaway: a read-heavy workload (summarizing documents, answering questions about existing text) is far cheaper than a generation-heavy workload (writing long-form content, producing detailed reports) at the same total token count. If you’re building something that generates long output, that’s where most of your bill will come from.
Current pricing across the major providers
Rates below are standard, non-cached, non-batch pricing as of July 2026. Every provider changes prices periodically, so treat this as a snapshot rather than a permanent reference — the calculator above pulls from the same figures and is easier to keep bookmarked than a screenshot of this table.
OpenAI
- GPT-5.5 (flagship) — $5.00 input / $30.00 output per million tokens
- GPT-5.4 (mid-tier, half the price of 5.5 on both sides) — $2.50 / $15.00
- GPT-5.4 Nano (routing and high-volume tasks) — $0.20 / $1.25
OpenAI also offers Batch and Flex processing at roughly 50% off standard rates for workloads that can tolerate delay, and a Priority tier at a premium for latency-sensitive production traffic.
Anthropic
- Claude Opus 4.8 (flagship, complex reasoning and agentic coding) — $5.00 / $25.00
- Claude Sonnet 5 (best price-to-performance in the lineup) — $2.00 / $10.00 introductory through August 31, 2026, then $3.00 / $15.00
- Claude Haiku 4.5 (fastest and cheapest current-generation model) — $1.00 / $5.00
Anthropic’s pricing is unusually predictable: every current model keeps the same 5x output-to-input ratio, and prompt caching cuts cached input to roughly 10% of the standard rate.
Google Gemini
- Gemini 3.1 Pro (flagship reasoning, 1M context) — $2.00 / $12.00 up to 200K tokens of input, doubling to $4.00 / $18.00 beyond that
- Gemini 3.5 Flash (frontier-adjacent speed, native grounding) — $1.50 / $9.00
- Gemini 3.1 Flash-Lite (budget tier) — $0.25 / $1.50
Google is the one provider here with a context-length cliff: cross 200K input tokens on a Pro-tier model and the rate doubles for the entire request, not just the tokens past the threshold. Worth designing around if you’re working with long documents.
How to estimate your monthly AI costs
The formula is the same regardless of provider:
(monthly input tokens ÷ 1,000,000 × input price) + (monthly output tokens ÷ 1,000,000 × output price)
The hard part isn’t the math — it’s estimating your token volume before you have real usage data. A reasonable starting point: multiply your expected daily requests by your average input and output tokens per request, then multiply by 30. Once you have even a few days of real traffic, replace the estimate with actual numbers from your provider’s usage dashboard, since actual usage is often higher than planning estimates once conversation history, retries, and tool definitions are factored in.
Five ways to cut your AI API bill
Prompt caching
If your application repeatedly sends the same system prompt, few-shot examples, or document prefix, caching lets subsequent requests read that content at a fraction of standard input price — roughly 90% off on Anthropic and comparable savings on OpenAI and Google. This is usually the single biggest lever for chatbots and agents with stable instructions.
Batch processing
Every major provider offers an asynchronous batch mode at roughly 50% off standard pricing, with results returned within 24 hours. Good for anything that doesn’t need a real-time response — nightly data processing, bulk content generation, evaluation runs.
Model routing
Not every request needs your most expensive model. Routing simple classification, extraction, and short-response tasks to a budget model while reserving the flagship for genuinely hard reasoning can cut blended costs 30-40% without a noticeable quality drop for most users.
Which model should you choose?
Cheapest-per-token is rarely the right question on its own. A model that requires more retries, longer prompts to get the same result, or produces output you have to edit by hand can end up costing more in total than a pricier model that gets it right the first time. Treat the numbers in the calculator above as your starting filter, then validate quality on your actual use case before committing production traffic to any single model.
As a general starting point: route high-volume, low-complexity tasks (classification, tagging, short summaries) to a budget-tier model; use a mid-tier model for most production workloads; and reserve flagship models for the requests where getting it right the first time is worth the premium.
Conclusion
AI pricing moves fast, but the structure behind it doesn’t: input and output tokens, tiered models, and a handful of discount levers you either use or leave on the table. Bookmark the calculator above to run your own numbers whenever you’re evaluating a new model or workload — it pulls from the same rates as this guide, and we keep both updated as providers change pricing.