Search tools

Search for a command to run...

AI API Cost Calculator (LLM Token Pricing)

Estimate what an LLM-powered feature will cost — tokens per request, requests per month, input/output prices per million tokens, prompt caching and batch discounts. Works for any model: enter your provider's current prices.

Results are estimates for planning; real-world values vary.

How to use

  1. 1Enter the average input (prompt) and output (response) size of one request — in tokens, or words if you don't know the token count.
  2. 2Enter how many requests you expect per month.
  3. 3Copy the model's input and output prices per million tokens from your provider's pricing page.
  4. 4Add the share of input served from the prompt cache and any batch discount if you use them.

How it's calculated

Cost per request = (uncached input × input price + cached input × cache price + output × output price) ÷ 1,000,000, then × (1 − batch discount). Words are converted at about 1.33 tokens per English word.

Frequently asked questions

How many tokens is a word?

For English text, roughly 3/4 of a word per token — 100 words ≈ 133 tokens. Code, non-English text and numbers use more tokens per word. Your provider's tokenizer gives the exact count.

Why is output more expensive than input?

Output tokens are generated one at a time, which takes much more compute than reading the prompt. Output prices are typically 3–5× the input price.

What is prompt caching?

If many requests share a long identical prefix (system prompt, documents, examples), providers can cache it and bill those tokens at a steep discount — often 90% off the normal input price.

Where do I find current prices?

On your AI provider's pricing page. Prices change often and differ per model, so this calculator lets you enter them rather than relying on a built-in list that could go stale.