Calculate

App Store

Download iCalc Photo Math Calculator

Take calculators with you and solve math faster on iPhone.

104

AI Token Cost Calculator

Estimate AI API token cost from input, cached input, and output token usage plus per-million pricing.

Sponsored

Inputs

AI Token Cost

Enter the token counts for one request and the pricing for your model in dollars per 1 million tokens.

Result

--

How It Works

How the AI Token Cost Calculator works

Inputs used

Enter Requests, Input tokens, Cached input tokens, Output tokens, Input price, Cached input price, and Output price. Those values let the page estimate AI API token cost from input, cached input, and output token usage plus per-million pricing.

Calculation method

This calculator prices each token bucket separately because many AI models bill input, cached input, and output tokens at different rates.

It first calculates the cost of one request from the entered token counts and per-million token prices, then multiplies that amount by the number of requests.

Per request cost

\[Cost_{request} = \frac{T_{in}R_{in} + T_{cache}R_{cache} + T_{out}R_{out}}{1{,}000{,}000}\]

T values are token counts and R values are prices in dollars per 1 million tokens.

Total cost

\[Cost_{total} = Requests \times Cost_{request}\]

Use the requests field to scale one-call pricing into a batch or workload estimate.

What the result means

The main result shown here is total cost. The calculator also returns per request cost, input cost, output cost, cached input cost, and total tokens so you can review the most useful supporting numbers at the same time.

Sponsored