CalcWorldHub
Free online calculator · no signup

LLM API token cost calculator

Estimate per-request, daily, and monthly language-model API costs from token usage and the rates you enter.

4,000 tools
LLM API token cost calculator — Input tokens per request, Output tokens per request, Input price ($ per 1 million tokens) and calculation method
LLM API token cost calculator: inputs and calculation method.

How to use this calculator

Estimate per-request, daily, and monthly language-model API costs from token usage and the rates you enter.

  1. Enter Input tokens per request, Output tokens per request, Input price ($ per 1 million tokens), Output price ($ per 1 million tokens), then complete the remaining labeled fields. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Computer science calculation

How this calculation works

Text-generation APIs commonly price input and generated output tokens separately. This estimator multiplies average token counts by the current per-million-token prices you supply, then scales the per-request result by daily request volume and billing days.

Inputs and units

inputTokens — Input tokens per request
Average prompt and other billable input tokens per request.
outputTokens — Output tokens per request
Average generated output tokens per request.
inputRate — Input price ($ per 1 million tokens)
Current provider price for one million input tokens.
outputRate — Output price ($ per 1 million tokens)
Current provider price for one million output tokens.
requestsPerDay — Requests per day
Expected average request volume each day.
days — Billing days in period
Number of usage days in the projection period.

Formula

Displayed formula

Input cost/request = input tokens/request × input rate per 1,000,000 tokens. Output cost/request = output tokens/request × output rate per 1,000,000 tokens. Period cost = cost/request × requests/day × days.

Method

Enter current rates from the provider’s pricing page in dollars per million tokens. Use representative average input and output token counts for the selected endpoint; add requests and billing days for a monthly projection.

Worked example

At 1,200 input tokens and 500 output tokens per request, with rates of $2 and $8 per million tokens, each request costs $0.0064. At 1,000 requests per day for 30 days, the estimate is $192.

Assumptions and limits

Provider rates, model versions, context caching, batch discounts, tool calls, image or audio tokens, and taxes can change the bill. This estimate models only the token rates and usage values entered; verify the current provider invoice rules.

Frequently asked questions

Where should I get the token rates?

Use the provider’s current pricing page for the exact model and endpoint; prices can change and may differ by token type.

Does the estimate include cached tokens or tool calls?

No. Enter applicable average token counts and rates yourself; this page does not model caching, tools, images, audio, or other price categories.

Why can an invoice differ from this estimate?

Actual tokenization, retries, context caching, model routing, discounts, taxes, and billing rules can change the final amount.

How do I use the LLM API token cost calculator?

Enter Input tokens per request, Output tokens per request, Input price ($ per 1 million tokens), Output price ($ per 1 million tokens), then complete the remaining labeled fields. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of LLM API token cost?

At 1,200 input tokens and 500 output tokens per request, with rates of $2 and $8 per million tokens, each request costs $0.0064. At 1,000 requests per day for 30 days, the estimate is $192.