Estimate AI API Spend With Separate Input and Output Tokens
Estimate token-based API cost using input and output rates you supply.

The short answer
Estimate token-based API cost using input and output rates you supply.
What changes the result
Input and output may have different rates, so a blended price can hide the effect of long generated answers. This calculator applies user-entered prices to separate token totals. Example rates are illustrative and are not a live provider price list.
A worked example
100,000 input tokens at an example $1/million plus 20,000 output tokens at an example $4/million costs $0.18.
Check the calculation yourself
Cost = input tokens / 1,000,000 × input price + output tokens / 1,000,000 × output price.
For a reproducible starting point, the paired calculator’s default inputs are:
- Input tokens: 100000
- Output tokens: 20000
- Your input price ($ per million tokens): 1
- Your output price ($ per million tokens): 4
| Example output | Result |
|---|---|
| Estimated token cost | $0.18 |
| Input cost | $0.1 |
| Output cost | $0.08 |
Try the AI API Cost Calculator →
A common mistake to avoid
Input and output can have different rates. Check the exact provider, model, billing unit and current pricing before budgeting.
Before you use the answer
Read the provider’s current billing units, include all relevant requests and compare estimated token totals with actual usage records.
Default prices are invented examples, not a provider’s current pricing. No API calls are made; cached, audio, image and tool charges are excluded.
Questions and answers
What do the default inputs represent?
They are illustrative examples, not current offers, personal recommendations, or a prediction. Replace them with your own relevant values.
How should I check the answer?
Use the formula and worked example on this page. Keep time periods and units consistent and read the stated model limits.
Sources and method
Prices and model limits are user inputs. Check the selected provider’s current official documentation before budgeting. This page does not maintain a live price feed or call an AI service.
This guide is published by UnitEngine. Examples are illustrative. Read how we check formulas or report an error.


