LLM API cost calculator

Estimate what a workload costs per request, month and year.

How it’s calculated

Cost = (Input tokens ÷ 1,000,000 × Input price) + (Output tokens ÷ 1,000,000 × Output price)

Enter your provider’s current prices per million tokens. The defaults are examples only. Cached input, batch discounts and taxes are not included.

Related tools

See all Lodge Tools →

Model prices and limits change often. Check the provider’s current pricing before you budget. Calculations run in your browser; nothing you enter is stored. Read our disclaimer.

About this LLM API cost calculator

This LLM API cost calculator estimates what an AI workload costs. First, enter the tokens per request and how many requests you make each month. Then enter your provider’s prices per million tokens. As a result, you see the cost per request, per month and per year. It works for OpenAI, Anthropic Claude, Google Gemini and other APIs.

How to use the LLM API cost calculator

  1. First, enter the input tokens per request. These are the tokens in your prompt.
  2. Next, enter the output tokens per request. These are the tokens the model writes back.
  3. Then enter how many requests you expect each month.
  4. Finally, enter your provider’s current input and output prices per million tokens.

Not sure of your token counts? In that case, paste a typical prompt into the LLM token counter first.

How LLM API pricing works

Most AI providers charge per million tokens. In addition, they usually price input and output tokens differently. Output tokens often cost several times more than input tokens. Also, some reasoning models bill hidden reasoning tokens as output. Some providers charge less for cached input or batch requests. However, this calculator leaves those discounts out, so it gives a cautious estimate.

LLM API cost formula and example

Cost per request = (input tokens ÷ 1,000,000 × input price) + (output tokens ÷ 1,000,000 × output price). Then multiply by your monthly requests.

For example, take 1,000 input tokens and 500 output tokens per request. At example prices of $3 and $15 per million, each request costs $0.0105. So 10,000 requests a month cost $105, or $1,260 a year.

Output often drives the bill. For instance, cutting output to 250 tokens drops the monthly cost to $67.50. By contrast, halving the input to 500 tokens only drops it to $90. In other words, shorter answers can save more than shorter prompts.

Why the prices are not built in

AI providers change their prices often. So the calculator uses example prices that you can edit. Always check your provider’s pricing page before you set a budget.

LLM API cost calculator FAQs

How do I calculate LLM API cost?

First, divide your input and output tokens by 1,000,000. Then multiply each by its price per million tokens. Finally, add both parts and multiply by your number of requests.

Are input and output tokens priced the same?

Usually not. Most providers charge more for output tokens than for input tokens. So check both prices on your provider’s pricing page.

How do I find my token counts?

Paste a typical prompt into the LLM token counter for an estimate. Alternatively, check the usage figures your provider returns with each API response.

Does the estimate include tax or discounts?

No. It leaves out taxes, cached input pricing and batch discounts. So your actual bill may differ.

Which currency does the calculator use?

It uses US dollars, because AI providers publish their API prices in USD.