AI API Cost Calculator.
Estimate token costs with your provider’s own rates.
Example inputs only — replace all rates with your own data. USD throughout.
Set your assumptions
Start with an estimate. Fine-tune as you go.
Estimated API cost
Where the numbers come from
Transparent math. No black box.
(Input tokens × Input rate + Output tokens × Output rate) ÷ 1,000,000Enter current provider rates. Caching, batch discounts, tool calls, images, audio, and other charges are excluded.
Keep exploring
More clarity, one calculation at a time.What this calculator does
Estimate token costs with your provider’s own rates. This ai api cost model estimates estimated api cost from your inputs.
Formula
(Input tokens × Input rate + Output tokens × Output rate) ÷ 1,000,000
Methodology
Substitute the inputs below into the formula in the stated units. Percentage inputs use a 0–100 scale and are divided by 100 in the calculation. Calculations use unrounded inputs; displayed currency rounds to two decimal places. Annualized monthly results multiply by 12 without forecasting growth. Large estimates are approximate because JavaScript uses floating-point arithmetic.
Inputs
- Monthly input tokens — tokens; allowed range 0–1,000,000,000,000. Editable example; use the units stated in the label.
- Input price per million tokens — $; allowed range 0–10,000,000. Editable example; use the units stated in the label.
- Monthly output tokens — tokens; allowed range 0–1,000,000,000,000. Editable example; use the units stated in the label.
- Output price per million tokens — $; allowed range 0–10,000,000. Editable example; use the units stated in the label.
Outputs
Estimated API cost, in USD per month. The annualized estimate is twelve times the monthly result. Reverse solving targets this same output, not a different revenue or profit measure.
Assumptions
Enter current provider rates. Caching, batch discounts, tool calls, images, audio, and other charges are excluded.
Example
1.25 million × $0.40 + 0.25 million × $1.20 = $0.50 + $0.30 = $0.80.
Limitations
All results are scenarios, not guaranteed outcomes. The sensitivity table changes one input at a time by the requested percentage, capped at its valid bounds. A zero starting input stays zero. Reverse solving holds other assumptions fixed and may produce fractional counts. Rounding those counts can change the result.
Sources
USER-ENTERED: all rates and multiples are editable illustrative assumptions. No live platform pricing, payout data, or valuation benchmark is used. Replace example values using your own billing agreement and analytics. The methodology and worked example above document the arithmetic; they are not external market evidence.
FAQ
What does AI API Cost calculate?
Estimate token costs with your provider’s own rates. The primary output is estimated api cost in USD per month.
Are the default rates current platform prices or typical earnings?
No. Every prefilled rate is an editable example, not a verified current price, payout, commission, or market benchmark. Replace it with your own agreement, provider billing rate, or realized analytics.
How does the reverse solver work?
Choose one input and a target for estimated api cost. Other inputs stay fixed. The solver searches only within that input’s allowed range. Constant relationships and unattainable targets have no unique solution. Counts are continuous estimates; operational counts may need rounding up.
What is excluded from this estimate?
Enter current provider rates. Caching, batch discounts, tool calls, images, audio, and other charges are excluded.
Last reviewed
— formula and implementation review; not verification of external rates.