
Rex says
Money math without the spreadsheet headache. Plug in your numbers and I'll show you exactly where the dollars land.
Try a scenario
Click to load — tweak from there.Inputs
Result
Total monthly API cost
$2,400.00
Cost per request
$0.01200
Total input token cost
$900.00
Total output token cost
$1,500.00

Psst — share this and help Rex grow
One click, a permanent link with your numbers baked in.
How to use this
- 1Enter avg input tokens per request.
- 2Enter avg output tokens per request.
- 3Enter input rate ($/1M tokens).
- 4Enter output rate ($/1M tokens).
- 5Enter requests per month.
- 6Enter cached input discount (%).
- 7Read your total monthly api cost on the right — it updates as you type.
- 8Hit Share to keep the scenario or send it to someone.
About this calculator
LLM APIs bill separately for input tokens (your prompt plus any retrieved context) and output tokens (the model's response), usually at different rates since output generation is more compute-intensive per token than input processing. This calculator takes your average input and output token counts per request, separate per-million-token rates for each, and monthly request volume to compute total spend, plus a per-request cost that's useful for pricing your own product on top of the API. As a practical estimation note, English text averages roughly 4 characters or about 0.75 words per token, so a 1,000-word prompt is roughly 1,300-1,400 tokens — use your provider's actual tokenizer for precise counts since this varies by model family, but the 4-characters-per-token rule gets you within about 10-15% for rough budgeting.
Worked example
Using the values the calculator loads with:
Inputs
- Avg input tokens per request: 1500
- Avg output tokens per request: 500
- Input rate: 3 $/1M tokens
- Output rate: 15 $/1M tokens
- Requests per month: 200000
- Cached input discount: 0 %
Results
- Total monthly API cost: $2,400.00
- Cost per request: $0.012
- Total input token cost: $900.00
- Total output token cost: $1,500.00
What each field means
Inputs
- Avg input tokens per request
- The avg input tokens per request used in the calculation. Starts at 1500 so you have a working example on load.
- Avg output tokens per request
- The avg output tokens per request used in the calculation. Starts at 500 so you have a working example on load.
- Input rate ($/1M tokens)
- The input rate used in the calculation, measured in $/1M tokens. Starts at 3 $/1M tokens so you have a working example on load.
- Output rate ($/1M tokens)
- The output rate used in the calculation, measured in $/1M tokens. Starts at 15 $/1M tokens so you have a working example on load.
- Requests per month
- The requests per month used in the calculation. Starts at 200000 so you have a working example on load.
- Cached input discount (%)
- The cached input discount used in the calculation, measured in %. Starts at 0 % so you have a working example on load. Accepted range: 0–95 %.
Results
- Total monthly API cost
- Returned as a money amount in US dollars and shown as the headline result. It recalculates instantly whenever you change an input, so you can compare scenarios without reloading.
- Cost per request
- Returned as a money amount in US dollars. It recalculates instantly whenever you change an input, so you can compare scenarios without reloading.
- Total input token cost
- Returned as a money amount in US dollars. It recalculates instantly whenever you change an input, so you can compare scenarios without reloading.
- Total output token cost
- Returned as a money amount in US dollars. It recalculates instantly whenever you change an input, so you can compare scenarios without reloading.
FAQ
Why is output token pricing so much higher than input?
Generating output tokens requires a sequential forward pass per token (autoregressive decoding), while input tokens can be processed in parallel during the prefill phase, making output generation more compute-intensive per token. Most providers price output at 3-5x the input rate as a result, which is why long, verbose responses cost disproportionately more than long, information-dense prompts.
How much does prompt caching actually save?
Providers offering prompt/context caching typically discount repeated input tokens (a long system prompt or shared document context reused across requests) by 50-90%, since the model doesn't need to reprocess the cached prefix. For applications with a large shared system prompt or knowledge base, caching can cut total input cost dramatically even though it does nothing for the output side.
How do I estimate token count before I have real usage data?
Use the roughly 4-characters-per-token (English) or 0.75-tokens-per-word heuristic on sample prompts and expected responses, then validate against your provider's actual tokenizer (OpenAI's tiktoken, Anthropic's token counting endpoint) once you have real traffic. Non-English languages and code often tokenize less efficiently — expect 20-40% more tokens per character than the English heuristic suggests.
Accuracy and limitations
- Results are estimates before tax, fees, and inflation unless an input explicitly covers them.
- Rates are treated as fixed for the whole period — variable-rate products will drift from this projection.
- This is educational maths, not financial advice. Check anything contractual with the lender or your accountant.
Related tools
GPU Training Cost Calculator
Estimate the cloud GPU bill for a training run before you start it.
Vector Database Storage Cost Calculator
Estimate storage and index memory cost for embedding-based search.
Serverless Function Invocation Cost Calculator
Turn invocation count, duration, and memory into a monthly bill.
Cite this calculator
Writing about this topic? Grab a citation — every link helps keep these tools free.
RevenueLab. (2026). LLM API Token Cost Calculator. Retrieved from https://www.revenuelab.fyi/toolbox/llm-api-token-cost
<p>Source: <a href="https://www.revenuelab.fyi/toolbox/llm-api-token-cost" target="_blank" rel="noopener">LLM API Token Cost Calculator — RevenueLab</a> (2026).</p>
Source: [LLM API Token Cost Calculator — RevenueLab](https://www.revenuelab.fyi/toolbox/llm-api-token-cost) (2026).
