AI API Cost Calculator

AI API pricing looks simple until the first invoice: every provider charges per token, input and output tokens have different prices, and the gap between the cheapest and priciest models is more than 20×. A chatbot that feels free in testing can quietly burn hundreds of dollars a month in production, 78% of IT leaders reported unexpected AI charges in 2026. This calculator turns your expected usage into a monthly number before you commit.

Last updated: October 22, 2026

Approximate 2026 list prices per 1M tokens (standard, non batch, non cached). Your provider or plan may differ.

tokens Prompts, conversation history and retrieved context you send per month.

tokens Text the model generates per month. Rule of thumb: ~1,300 tokens per 1,000 English words.

The formula

  • Monthly cost = (input tokens × input price + output tokens × output price) ÷ 1,000,000
  • Input cost = monthly input tokens ÷ 1M × input price per 1M tokens
  • Output cost = monthly output tokens ÷ 1M × output price per 1M tokens
  • Daily cost ≈ monthly cost × 12 ÷ 365
  • Yearly cost = monthly cost × 12

A worked example

GPT-4o with 5M input and 2M output tokens a month: input costs $12.50, output costs $20.00, about $32.50 a month, $1.07 a day, $390 a year. Switch the same workload to GPT-4o mini and the bill drops to roughly $1.95 a month.

More about the AI API Cost Calculator

Input vs output: the two prices that matter

Every API call is billed twice: once for the tokens you send (your prompt, plus any conversation history or retrieved documents) and once for the tokens the model generates. Output tokens almost always cost more, typically 2× to 5× the input price, because generating text burns more compute than reading it. A chatbot with long answers on short questions pays mostly output tax.

The practical move is to estimate both sides separately. Prompts are usually stable and easy to measure; outputs vary with temperature, max tokens settings and how chatty the model is. When in doubt, overestimate outputs by 25%, real bills surprise on the generation side, not the prompt side. The other <a href="/work-career-calculators/">Work & Career calculators</a> cover the human side of the same budget.

Pick the cheapest model that clears your quality bar

Model tiers exist because most tasks do not need the flagship. Mini/flash-class models cost 10 to 30× less per token than top tier models and handle classification, extraction, summarisation and simple Q&A well. Reserve GPT-4o or Claude 3.5 Sonnet for the steps where quality visibly moves the needle, reasoning, code, nuanced writing, and route everything else down a tier.

Two more levers beat model hopping: prompt caching (repeat context billed at a steep discount on supporting providers) and shorter outputs (cap max tokens, ask for concise answers). Together they often cut a bill in half without changing models at all. Re run this calculator after each change, the monthly figure is the scoreboard.

A worked monthly bill for a small support chatbot

Suppose your support chatbot handles 5,000 conversations a day, each averaging 800 input tokens, the question plus the context you send, and 400 output tokens of reply. Over a 30 day month that is 150,000 conversations, totalling 120 million input tokens and 60 million output tokens. On the mini class model priced on this page at $0.15 per million input and $0.60 per million output, the bill is 120 times $0.15 plus 60 times $0.60: $18 plus $36, which is $54 a month.

Run the identical workload on the flagship model priced at $2.50 per million input and $10.00 per million output and the same arithmetic gives 120 times $2.50 plus 60 times $10.00, $300 plus $600, a $900 monthly bill. Same conversations, same answers in length, sixteen times the cost. That gap is the entire argument for estimating before you build: the model choice, made casually in an afternoon, is worth $846 a month in this example alone.

Notice which side dominates. Even though this chatbot sends twice as many input tokens as it receives, output still produces two thirds of the mini bill and two thirds of the flagship bill, because output tokens carry the higher price. When you hunt for savings, measure your real output lengths first, developers routinely discover their model writes replies twice as long as anyone reads, and trimming them is the cheapest optimisation that exists.

The hidden multiplier: conversation history

Most API bills surprise their owners through one mechanism: history. A stateless API call knows nothing about your previous messages, so chat applications resend the conversation so far with every new turn. A fresh question might be 500 tokens, but by turn ten the request carries the whole transcript, and by turn twenty it carries all of that plus everything since. Your input tokens per call grow all session long, even though the user only typed one short line.

Put numbers on it. Suppose a long support session reaches the point where each call resends 10,000 tokens of history instead of a lean 500, and your product makes 30,000 such calls a month. The extra 9,500 tokens per call add up to 285 million extra input tokens. On the mini model at $0.15 per million that is about $42.75 a month of pure history tax; on the flagship at $2.50 per million it is about $712.50, for re reading words the model has already seen.

The fixes are mechanical, and the calculator shows their value before you implement them. Summarise older turns into a short brief instead of resending them verbatim, cap the history window at the last few exchanges, or use prompt caching where your provider offers it so repeated context bills at a discount. Re run your monthly estimate with the reduced input figure after each change; the difference between the two totals is your engineering budget for the work, stated in dollars.

Budgeting mistakes that produce surprise invoices

Testing with toy prompts is the classic trap. A developer tests with “Hello” and a two line instruction, sees fractions of a cent, and ships, then production traffic arrives carrying uploaded documents, retrieved passages, system instructions and long histories on every call. The per call cost in production can be twenty times the test cost with nobody doing anything wrong. Estimate with real, average production shaped requests: paste an actual conversation, count its tokens honestly, and budget from that.

Leaving output length uncapped is the second trap. Without a maximum, a model asked to explain, list or draft will happily generate thousands of tokens, and output is the expensive side of the bill. One runaway feature, a daily report generator, say, can outspend your entire chat traffic. Set a sensible maximum output for every feature, ask for concise formats in the prompt itself, and watch the output token average the way you watch any other production metric.

The third trap is forgetting the traffic you do not see: retries after timeouts, evaluation runs, staging environments pointed at live keys, and the enthusiastic internal demo that loops overnight. Each is billed like a customer. Separate keys per environment, spending alerts at thresholds you choose, and a monthly pass through this calculator with updated traffic figures will catch all three while they are still small numbers instead of an invoice you have to explain.

Routing: the two model pattern that cuts most bills

The worked chatbot example showed a sixteen fold price gap between model tiers, and the routing pattern is how real products capture most of it. Send the easy majority, greetings, classification, short factual answers, formatting, to the mini class model, and reserve the flagship for the minority of requests that genuinely need deep reasoning, long documents or delicate writing. If 80 percent of your traffic routes down a tier, your blended cost lands far closer to the mini bill than the flagship one.

Routing needs a decider, and the decider can be simple: message length, whether a document is attached, which feature the user opened, or a tiny cheap classification call that labels the request before the main call answers it. Measure the split for a week with this calculator, total tokens on each tier, priced separately, then added, and you will know within a dollar or two what the pattern saves before you commit engineering time to building it.

How to use the AI API Cost Calculator

  1. Pick your AI model, the list shows approximate 2026 prices per 1M tokens.
  2. Enter your expected monthly input tokens (prompts, history, retrieved context).
  3. Enter your expected monthly output tokens (generated answers).
  4. Hit Calculate to see input cost, output cost, and the monthly, daily and yearly totals.

Frequently asked questions

How is AI API pricing calculated?

Providers charge per token, a token is roughly ¾ of an English word. Each model publishes two prices: per 1M input tokens (what you send) and per 1M output tokens (what the model generates). Your bill is (input tokens × input price + output tokens × output price) ÷ 1,000,000. There are no seat licences on pure API plans; you pay exactly for what you consume.

Why do output tokens cost more than input tokens?

Reading your prompt is one fast pass through the model; generating each output token requires a full forward pass per token, which burns far more GPU compute. That is why output prices run 2× to 5× higher, e.g. GPT-4o charges $2.50 per 1M input tokens but $10.00 per 1M output tokens. Long generated answers dominate most bills.

How many tokens is 1,000 words?

Roughly 1,300 tokens, the common rule of thumb is about 750 English words per 1,000 tokens. Code, non English text and special formatting tokenize less efficiently, so 1,000 words of code can be 1,500+ tokens. For budgeting, add a 20 to 30% safety margin on top of your word count estimate.

How can I reduce my AI API bill?

Five levers, biggest first: (1) route simple tasks to a mini/flash model; (2) use prompt caching for repeated context, up to 90% off cached input on some providers; (3) cap max output tokens and ask for concise answers; (4) trim conversation history instead of resending full transcripts; (5) batch requests where latency allows. Measure with this calculator after each change.

Are these prices exact?

No, they are approximate 2026 public list prices per 1M tokens, for standard (non batch, non cached) usage. Providers change prices, offer volume tiers, cached input discounts and batch discounts up to 50% off. Always confirm against your provider's current pricing page before signing a budget; treat this calculator as a planning estimate.

How much does one chatbot conversation cost?

Take a conversation of 800 input tokens and 400 output tokens. On the mini model priced here at $0.15 per million input and $0.60 per million output, that is $0.00012 plus $0.00024, about $0.00036, roughly a third of a cent per ten conversations. On the flagship at $2.50 and $10.00 per million, the same conversation costs $0.002 plus $0.004, which is $0.006. Volume turns those fractions into real money.

Does streaming the response change what I pay?

No. Streaming changes when tokens arrive, not how many exist. You are billed for the same input tokens you sent and the same output tokens the model generated, whether they appear word by word or all at once. Where streaming does help cost is behaviour: users who see an answer going wrong can stop generation early, and a stopped generation only bills for the tokens actually produced before the stop.

Are embedding calls billed the same way?

Embeddings are simpler: you pay only for input tokens, because the model returns a vector of numbers rather than generated text, so there is no output side to the bill. Embedding a document collection is therefore a one off indexing cost per document, after which the stored vectors are reused for every search. In the calculator, model an embedding workload as input tokens with output set to zero to see its true shape.

What does prompt caching actually save?

When many calls share the same long opening context, system instructions, a product manual, a legal disclaimer, caching lets the provider bill the repeated portion at a steep discount instead of full input price on supporting models. The saving applies only to the cached share of your input, so it matters most when that shared block is large and your unique per call content is small. In the calculator, model it by reducing your effective input price for the cached portion and comparing totals.

Does the calculator include fine tuning costs?

No, it estimates inference, the per token cost of running a model, which is what your ongoing traffic pays. Fine tuning is a separate kind of charge: training is typically billed per token in your training data, and some providers add hosting fees for the resulting model, after which inference rates for that model apply. Budget the two separately: training as a project cost, then run your expected traffic through this calculator for the running cost.