API Token Cost Calculator
Estimate LLM API cost from input and output tokens.
Default 1
Results update as you type.
How it works
Large language model APIs charge by the token, and costs can scale fast at volume, so this calculator estimates them. You enter the input and output tokens per request, the per-million-token prices for each, and the number of requests, and it returns the cost per request and the total cost. Modern LLM providers price tokens per million and almost always charge more for output (generated) tokens than for input (prompt) tokens, often several times more, because generation is more compute-intensive. The calculation converts each token count to millions, multiplies by the respective price, sums them for the per-request cost, and scales by your request volume. This is essential for anyone building on LLM APIs: a cost that looks tiny per request, fractions of a cent, becomes significant across thousands or millions of requests, so understanding it helps with budgeting, pricing your own product, and optimizing. Tokens are chunks of text, roughly three-quarters of a word on average in English, so a 1,000-token prompt is about 750 words. To estimate costs, count or approximate the tokens in your typical prompt and expected response, and use your provider's current per-million rates, which vary widely by model, with more capable models costing more. Reducing prompt length, caching, and choosing an appropriately sized model are common ways to cut token costs. Enter your tokens, prices, and request count to estimate the cost.
Cost = (input/1M × input price) + (output/1M × output price), × requests
Large language model APIs price tokens per million, usually charging more for output than input tokens. The cost per request is the input tokens divided by a million times the input price, plus the output tokens divided by a million times the output price. Multiplying by the number of requests gives the total.
Source:LLM API pricing
We review all our tools from time to time to ensure accuracy.
Worked example
How to use this calculator
- 1
Enter your values
Enter input tokens per request, output tokens per request, input price per 1m tokens and output price per 1m tokens.
- 2
Adjust the options
Adjust number of requests if they apply — sensible defaults are already set.
- 3
Read your result
Cost per request updates instantly as you type — no button to press.
Frequently asked questions
How is LLM API cost calculated?
Providers price tokens per million. Divide your input tokens by a million and multiply by the input price, do the same for output tokens and the output price, then add them for the cost per request. Multiplying by your number of requests gives the total. The calculator handles this from your token counts and prices.
Why do output tokens cost more than input tokens?
Output tokens, which the model generates one at a time, are more computationally expensive to produce than input tokens, which the model reads. Because of this, providers typically charge several times more per output token. When estimating costs, the output price often dominates for responses that are long relative to the prompt.
What is a token?
A token is a chunk of text the model processes, often a word or part of a word. In English, a token averages about three-quarters of a word, so roughly 1,000 tokens equal about 750 words. Both your prompt (input) and the model's response (output) are measured in tokens, and both count toward cost.
How can I reduce token costs?
Shorten prompts by removing unnecessary context, limit the maximum output length, use prompt caching if your provider offers it to avoid re-processing repeated context, and choose the smallest model that meets your quality needs, since more capable models cost more per token. Batching and efficient prompt design also help control costs at scale.
Why does per-request cost matter at scale?
A cost of a fraction of a cent per request feels negligible, but multiplied across thousands or millions of API calls it becomes a major expense. Estimating the per-request cost and projecting it to your expected volume reveals the true cost of a feature, which is essential for budgeting and for pricing a product built on the API profitably.