Skip to content
Koit Academy

AI API cost calculator

Your numbers

The numbers filled in are an example. Replace them with yours.

Monthly cost

360.00 a month

1,000 requests a day at 0.0120 each comes to 12.00 a day over 30 days. Output is 25% of the tokens and 63% of the cost.

How it adds up

ItemInputOutputTotal
Per request0.004500.007500.0120
Per 1,000 requests4.507.5012.00
Per day4.507.5012.00
Per month135.00225.00360.00
Per year1,620.002,700.004,320.00

Prices are per million tokens and change often, so use your provider’s current pricing page. Not included: discounts for cached input or batch requests where a provider offers them, and reasoning tokens some models bill as output.

Worked out from the numbers you enter. Calculated in this browser; nothing you enter is sent anywhere or stored.

How to use it · free, no signup

How to use the AI API Cost Calculator

Enter your requests a day, the input and output tokens per request and your provider’s prices to see the cost per request, day, month and year. Calculated in your browser.

  1. 01

    Enter the volume

    Requests a day, and the days a month they happen.

  2. 02

    Enter the tokens

    Average input and output tokens for one request.

  3. 03

    Enter the prices

    Input and output prices per million tokens, from your provider.

How API pricing works

Language model APIs charge for the tokens they read and the tokens they write, priced per million tokens, with output usually priced higher. The cost of a request is input tokens times the input price plus output tokens times the output price. The example uses 1,000 requests a day of 1,500 input and 500 output tokens, at prices of 3 and 15 per million.

PeriodInputOutputTotal
Per request0.00450.00750.012
Per day4.507.5012.00
Per month, 30 days135.00225.00360.00
Per year1,620.002,700.004,320.00

Why output is most of the bill

In the example, output is a quarter of the tokens but about 63% of the cost, because each output token costs five times as much as an input token. That changes where savings come from. Asking for shorter answers, or a set format with no preamble, often cuts the bill more than trimming the prompt does.

Ways to lower the cost

  • Cap the answer length in the prompt and with the API’s maximum output setting.
  • Use a smaller model for simple tasks such as classification or extraction, and keep the larger one for work that needs it.
  • Shorten repeated instructions, which are paid for on every request.
  • Use cached input or batch pricing where your provider offers it, for long shared context or work that can wait.

Estimating tokens before you have traffic

Once a service is running, the API reports the tokens of every response and the averages are easy to measure. Before that, paste a typical prompt and a typical answer into the token counter for an estimate. To check that a long prompt fits the model at all, use the context window calculator, and to see whether the time the tool saves covers what it costs, the AI ROI calculator.

Published by Koit Academy. Who runs it, how it is paid and how its tools are checked.

Questions

What people ask about the AI API Cost Calculator

How is the cost of an API request calculated?
Input tokens times the input price plus output tokens times the output price, with prices per million tokens. 1,500 input tokens at 3 and 500 output tokens at 15 cost 0.0045 plus 0.0075, or 0.012.
Why are output tokens more expensive?
Providers usually price output several times higher than input, because generating text takes more computation than reading it. That is why output can be most of the bill even when it is a minority of the tokens.
Where do I find the prices?
On your provider’s pricing page, per model. They change often, which is why the calculator does not include them.
How do I know how many tokens a request uses?
Most APIs report the input and output tokens of every response. Before you have real traffic, estimate from typical text with the token counter.
Does this include discounts?
No. Some providers charge less for cached input or batch requests. If yours does, lower the input price to the effective rate you pay.