LLM API cost calculator
LLM API cost per request is input tokens times the input price plus output tokens times the output price, both quoted per 1 million tokens. Enter your volume, average token counts and the current prices from your provider's pricing page to get a daily, monthly and yearly total.
Your workload
Use 30 for a service that runs every day.
Prices you enter
Copy the current price from your provider's pricing page. Use the same currency for both.
Characters to tokens estimate
Not sure how many tokens your text uses? A rough estimate is about 4 characters per English token (OpenAI's rule of thumb, see OpenAI's token guide). It is an approximation. Other languages and code use more tokens per character, so check your provider's tokenizer for an exact count.
Estimated tokens
-
Estimated cost
Enter both prices to see the cost.
Amounts are in the currency you enter the prices in. Prices are never stored.
How to use this tool
- Open your provider's pricing page and note the price per 1 million input tokens and per 1 million output tokens for the model you plan to use.
- Enter how many requests you expect per day and how many days a month the workload runs.
- Enter the average input tokens and output tokens per request. If you only know character counts, use the characters-to-tokens estimate to get a starting figure.
- Enter the two prices. The calculator shows the cost per request and the daily, monthly and yearly totals.
- Re-run it with a higher volume or a longer prompt to see how cost scales before you commit to a model.
Frequently asked questions
How is LLM API cost calculated?
Most providers bill input and output tokens separately, each priced per 1 million tokens. Cost per request = input tokens / 1,000,000 x input price + output tokens / 1,000,000 x output price. Multiply by requests per day and days per month for the monthly total.
How many tokens is a piece of text?
OpenAI's rule of thumb for English text is about 4 characters per token, or roughly three quarters of a word. It is an approximation: other languages and code usually use more tokens per character, so use your provider's tokenizer for an exact count.
Why does the calculator not include model prices?
Model prices change often, so a stored price table would go stale. You enter the current price from the vendor's own pricing page and the result always reflects the number you typed.
Sources
- What are tokens and how to count them?. OpenAI Help Center
Last updated