LLM API Cost Calculator
Find your monthly AI API cost from requests and tokens. This free tool needs JavaScript. Please turn it on.
How to use
- Choose a model size, or edit the price per million tokens for your own model.
- Type requests per day, input tokens and output tokens per request.
- Add extra tokens if you attach retrieved documents (RAG).
- Set the share of input that is cached, if you use prompt caching.
- Read the cost per request, per day, per month and per year.
About
AI features are paid by the token. A small prompt is cheap, but a long prompt with attached documents, repeated for thousands of users, becomes a real monthly bill. This calculator shows that bill before you build.
The model prices in the table are illustrative size tiers. They are not the current price of any one provider or model. Prices change often, so type in the prices from your provider pricing page.
Cached input tokens are usually cheaper than normal input tokens. If your system prompt repeats on every call, caching can reduce cost a lot. The table at the bottom shows what happens when your traffic grows.
Questions
What is a token?
A token is a small piece of text, about four characters or three quarters of a word in English. Providers charge per million tokens, with a different price for input and output.
Why is output more expensive than input?
Most providers charge a higher price for tokens the model writes than for tokens it reads. Check your provider page for the exact prices.
What is prompt caching?
If the start of your prompt is the same on many calls, the provider can reuse it at a lower price. Enter the share of your input that repeats.
What is RAG context?
Retrieval augmented generation adds document text to the prompt. Those extra tokens are charged as input on every request.
Are the default prices current?
No. They are illustrative. Replace them with the current prices from your provider.