#Why AI costs surprise people
LLM pricing is per token, and tokens are invisible during development. A feature that feels cheap when you test it forty times becomes a serious line item at forty thousand requests a day. The failure mode is nearly always the same: nobody multiplied.
This calculator makes the multiplication explicit. Describe one request — input tokens and output tokens — set your volume, and see projected daily, monthly and annual spend across every major model family.
#Estimating tokens without measuring them
For English prose, one token averages roughly 0.75 words, so:
- 1,000 tokens ≈ 750 words ≈ 4,000 characters
- A typical page of text ≈ 500 tokens
- A 20-page PDF ≈ 12,000 to 15,000 tokens
Two adjustments matter:
Code and structured data tokenise less efficiently. JSON, XML and source code produce 30% to 50% more tokens than plain English of the same character count, because punctuation and indentation fragment into separate tokens.
Non-Latin scripts are worse. Chinese, Japanese, Korean, Arabic and Hindi commonly use two to three times more tokens per unit of meaning than English. If you serve those languages, budget accordingly.
When precision matters, measure with your provider's tokeniser rather than estimating.
#Prompt caching is the highest-leverage optimisation
If a substantial portion of your input is identical across requests — a long system prompt, a tool schema, a product catalogue, a document being asked about repeatedly — caching it typically reduces the cost of that portion by around 90% on each read.
The effect on total spend is large. Consider a retrieval-augmented workload with 18,000 input tokens, of which 15,000 are a stable context block:
- Without caching: you pay full input price on all 18,000 tokens, every request
- With caching: you pay full price on 3,000 and roughly a tenth on 15,000
That is a 70%+ reduction in input cost, and input is usually the dominant term in RAG workloads. Move the cache slider in this calculator to see the effect on your numbers.
For caching to work, the cached content must be a stable prefix. Put the unchanging material first — system prompt, tools, documents — and the variable user content last. Reordering a prompt so the variable part sits at the end is often a one-line change worth thousands of dollars a month.
#When batch processing applies
Batch APIs accept a large set of requests and return results asynchronously, typically within 24 hours, at roughly half the standard price.
Good candidates: classification, tagging, enrichment, embedding generation, bulk summarisation, evaluation runs, dataset labelling, nightly report generation.
Bad candidates: anything a user is waiting on. There is no partial credit for a chat response that arrives tomorrow.
A common pattern is to split the workload: interactive requests go to the synchronous API, while the background pipeline that processes yesterday's data goes to batch. Many teams find 60% to 80% of their token volume is genuinely asynchronous once they look.
#Cheaper is not automatically cheaper
The cost-per-token comparison in the table is only half the decision. A smaller model that requires three attempts, longer few-shot prompts, or human correction can cost more in total than one call to a more capable model — before counting the engineering time spent tuning around its limitations.
The metric that matters is cost per successfully completed task, not cost per token. Use this calculator to size the raw gap, then run a real evaluation on your own data to find the quality difference. If the capable model is 10× the price but succeeds 99% of the time versus 82%, the arithmetic often favours the expensive one.
A useful pattern is routing: send the easy majority of requests to a small model, and escalate only the cases where a cheap confidence check fails. Model this by running the calculator twice at your estimated split.
#Other levers worth modelling
Cap output length. Output tokens usually cost three to five times input tokens. A max_tokens limit and a prompt instruction to be concise is the fastest saving available, and often improves the product.
Trim the context. Sending twelve retrieved chunks when four would do triples your input cost. Better retrieval is cheaper than more context.
Cache at the application layer too. Identical requests should never reach the API. A simple hash-keyed response cache removes the duplicate traffic that every production system generates.
Set hard spend limits. Every provider offers budget alerts and caps. A runaway loop in a background job is the single most common cause of a shocking invoice.
#Keep the prices current
The default prices in this calculator are editable because model pricing changes frequently, and it has trended downward substantially. Before committing a budget, check the provider's pricing page and update the fields — then re-run. The relative ranking between model tiers is more stable than the absolute numbers.
If AI inference is becoming a material part of your cost of goods sold, feed the resulting gross margin into the SaaS metrics calculator to see what it does to your LTV and payback period.