AI & DevOps

LLM Token Cost Calculator

Forecast AI API spend from token volume, request count, caching, and model pricing.

LLMtokensAI costAPI pricingbudgeting

LLM token cost estimator

Forecast API spend from input tokens, output tokens, request volume, caching, and model pricing.

Pricing changes often. Edit the numbers below before using this for budgets.
Monthly cost
$23.06
30.4375-day average month
Daily cost
$0.76
At the selected request volume
Cost / request
$0.000758
Input + output tokens
Annual run-rate
$276.49
Daily cost × 365
Pricing presets are editable estimates. Check provider pricing before budgeting.

What this estimate does and does not do

This calculator estimates usage-based LLM API spend from token counts and editable prices. It is not a quote from any provider. Published model prices, cache discounts, batch pricing, rate tiers, tool-call fees, regional taxes, currency conversion, and enterprise agreements can all change the final bill. Use the result for planning and sensitivity analysis, then confirm live prices with the provider before making budget or procurement decisions.

Formula used

LLM providers usually price input and output tokens separately. Some also offer lower pricing for cached input tokens or batch jobs. This calculator models those variables explicitly.

effective input price = input price × (1 - cache hit) + cached input price × cache hit
cost/request = input tokens × effective input price / 1,000,000 + output tokens × output price / 1,000,000
daily cost = cost/request × requests/day
monthly cost = daily cost × 30.4375

Worked example

If each request sends 2,500 input tokens and receives 700 output tokens, at 1,000 requests per day, even small differences in output price can change the monthly run-rate quickly.

The key variables to stress-test are:

  • output tokens per request
  • requests per day
  • cache hit percentage
  • model price per million input and output tokens
  • batch, committed-use, or volume discounts

Assumptions

  • Pricing presets are editable estimates and should be checked before budgeting.
  • Token counts are assumed to be average tokens per request.
  • The calculator does not include vector database, orchestration, logging, hosting, or human review costs.
  • Monthly cost uses an average month length of 30.4375 days.

Ways to reduce cost

  • Cap maximum output tokens.
  • Cache repeated system prompts, documents, or context blocks where supported.
  • Route simple tasks to cheaper models.
  • Batch non-urgent jobs if provider discounts are available.
  • Track real token usage in production rather than relying on rough estimates.

Frequently asked questions

How is LLM API cost calculated?

Most LLM APIs bill input and output tokens separately. The calculator multiplies input tokens by the input price, output tokens by the output price, divides by one million, and then multiplies by request volume.

Are the model prices guaranteed to be current?

No. Provider prices change often, and enterprise discounts or batch pricing may apply. Treat the presets as editable planning examples and check your provider pricing page before budgeting.

Should system prompts and RAG context count as input tokens?

Yes. Input tokens include the user message, system prompt, conversation history, tool context, retrieved documents, and any other text sent to the model.

Why do output tokens often matter more than input tokens?

Output tokens are commonly priced higher than input tokens because generation is more computationally expensive. Capping output length is often one of the simplest cost controls.