Guide

How AI API pricing actually works

Every major commercial AI provider — OpenAI, Anthropic, Google, and the rest — prices API access per token, almost universally quoted as a rate per one million tokens (occasionally per one thousand, for older pricing pages). That single design choice is why understanding tokens, not words or API calls, is the real foundation of budgeting for an AI-powered feature or product. If you haven't already, our Token Counter is the natural companion to this calculator — it tells you how many tokens a given piece of text uses; this tool converts that number into a dollar figure.

Why output tokens usually cost more

Almost every provider charges a noticeably higher rate for output tokens (the text a model generates) than for input tokens (the text you send it) — commonly 3-5x higher, sometimes more. This reflects the actual computational asymmetry involved: processing input text that's already been tokenized is comparatively cheap, while generating each new output token requires a full forward pass through the model, repeated one token at a time. This is also exactly why prompts that request long, verbose responses cost meaningfully more than prompts that request short, precise ones, even when the input side is identical.

How this calculator computes your estimate

The math behind each figure is straightforward once you have accurate token counts: (input tokens ÷ 1,000,000) × input price, plus (output tokens ÷ 1,000,000) × output price, gives you cost per request. Multiply that by your monthly request volume for a monthly estimate, and by 12 again for a rough annual figure. The comparison table applies this same formula across every model in the reference list simultaneously, using the same token inputs, so you can see the relative cost gap between models side by side rather than recalculating manually for each one.

Costs this calculator doesn't include

To keep this tool honest about its scope, here's what it deliberately leaves out:

  • Fine-tuning and training costs, which most providers price completely separately from inference (usage) pricing.
  • Embeddings and vector-search costs, typically billed on their own, much cheaper rate card.
  • Batch or asynchronous processing discounts, which some providers offer at a reduced rate in exchange for non-real-time turnaround.
  • Prompt caching discounts, which several providers now offer for repeated, identical prompt prefixes across requests — potentially a significant saving for applications with a large, static system prompt.
  • Rate-limit or enterprise-tier pricing, which can differ from the standard public API rate card entirely at high volume.

If your use case involves any of the above, treat this calculator's output as a floor, not a complete estimate.

Practical budgeting tips

  1. Measure real token usage from actual API responses, not estimates, once you have any production traffic — every major provider returns exact token counts in each response, and that data will always be more accurate than the estimate in this tool or the Token Counter.
  2. Budget for the 90th percentile request, not the average, since a small share of unusually long conversations or documents can dominate your actual monthly total even if most requests are short.
  3. Watch for growth in conversation length specifically — multi-turn chat applications that resend full history with every message see token usage (and cost) grow roughly with the square of conversation length, not linearly, unless you implement summarization or truncation.
  4. Re-check pricing quarterly. Given how often providers adjust pricing — often downward, as models mature and infrastructure costs fall — a cost model built once and never revisited can drift meaningfully out of date within a few months.

Choosing a model on cost vs. capability

The cheapest model per token isn't automatically the cheapest way to accomplish a task. A smaller, faster model priced at a fraction of a flagship model's rate can still end up costing more in practice if it requires longer prompts, more retries, or additional post-processing to reach acceptable quality for your use case. The reference comparison table above is most useful as a starting filter — narrow down to two or three plausible candidates on price, then evaluate actual output quality on your specific task before committing to one at scale.

Frequently asked questions

Why does this calculator ask for input and output tokens separately?

Because nearly every provider charges a different rate for each. Output tokens — the text the model generates — are typically priced several times higher than input tokens, since generating text is more computationally expensive than reading it. Estimating them separately gives a much more accurate cost than assuming a single blended rate.

Are the prices on this page current?

They're a maintained reference point, not a live feed pulled from each provider's API. AI providers change pricing more often than most software categories — always check the provider's own pricing page before finalizing a budget or invoice-critical calculation.

Does this include the cost of embeddings, fine-tuning, or image generation?

No — this calculator is scoped to standard text-generation (chat/completion) pricing only. Embeddings, fine-tuning, batch processing, and image or audio generation are usually priced on entirely separate rate cards by each provider.

Why is my actual bill different from this estimate?

The most common causes are: your real average token counts per request differ from what you entered here, your request volume fluctuated month to month, you're being charged for a different tier or feature (like a larger context window or a fine-tuned model) at a different rate, or the provider changed pricing after this table was last updated.