Token and cost calculator
Estimate how many tokens a prompt uses and what a feature costs at your traffic. Everything runs in your browser.
Free, no sign-up, runs in your browser. Part of Inference Academy, a hands-on course on making LLM inference fast.
Per request
$0.00310
48% of it is input tokens
Per 1,000 requests
$3.10
Per day
$15.50
Per month (30 days)
$465
Where to cut cost first
- Output dominates: ask for shorter answers, cap max tokens, and avoid verbose formats.
- Route easy requests to a smaller model: if it is 10 to 20 times cheaper, sending 70% of traffic to it cuts cost by about 60 to 65%.
- Agents multiply all of this by the number of steps. Count tokens per task, not per call.
Next step
The maths behind this result
How many GPUs does your traffic really need?
This calculator uses the arithmetic the Inference Engineering course teaches step by step, with diagrams you can step through. The lesson is free to read.
Stay in the loop
New models, what hardware they need, and new lessons
An occasional email when a big open model ships or a new lesson goes up. No spam; unsubscribe in one click.
Frequently asked questions
How do I calculate the cost of an LLM API call?
Multiply input tokens by the input price and output tokens by the output price, both per million tokens, and add them. Cached input tokens are billed at the cache-read price. Then multiply by requests per day and by days per month. The calculator does this and shows each part.
How many tokens is a word?
In English, about 0.75 words per token, or about 4 characters per token, with typical tokenizers. Code, numbers and other languages use more tokens per word. Paste a real prompt into the calculator for a quick estimate, and use your provider's tokenizer for exact counts.
Why are output tokens more expensive than input tokens?
Input tokens are processed in parallel in one pass, while output tokens are generated one at a time, each needing a full pass over the model's weights. That makes each output token far more costly to serve, and prices reflect it, often three to five times the input price.
How can I cut LLM API costs?
Send fewer tokens (shorter prompts, trimmed context and retrieved chunks), cap output length, cache shared prompt prefixes, use batch APIs for work that can wait, and route easy requests to a smaller model. Measure quality after each change.
Are the prices in the calculator current?
The price tiers are illustrative. Choose Custom and enter your provider's current prices before relying on a result.