How to Estimate Your Monthly LLM API Cost (With a Worked Example)

How to Estimate Your Monthly LLM API Cost (With a Worked Example)

By Talk & Tool4 min read

You can estimate what an LLM feature will cost per month with a short formula: the tokens you send and receive per request, the price per million tokens, and how many requests you expect. Most surprises come from forgetting that conversation history is sent again on every turn, and that output tokens cost more than input tokens. This guide walks through the formula with a worked example and the main ways to bring the bill down.

The formula

Cost per request = (input tokens × input price + output tokens × output price) ÷ 1,000,000

Monthly cost = cost per request × requests per day × days in the month

Prices are quoted per million tokens, separately for input and output. Output tokens usually cost several times more than input tokens, so a feature that writes long answers is more expensive than one that reads a lot and answers briefly.

Step 1: measure your tokens

Tokens are not words. English text averages roughly three-quarters of a word per token, and code, numbers and non-English text often use more. Measure with a real tokenizer; the LLM token counter counts a prompt and shows the cost across models, and how to count tokens explains how tokenizers differ.

Count everything that goes in, not just the user's question:

  • The system prompt and instructions
  • Retrieved documents or context you add
  • The conversation so far, if you resend history
  • The user's new message

Then estimate the output from a handful of real answers.

Step 2: a worked example

A support chatbot receives 1,000 requests a day. Each request sends about 1,500 input tokens (system prompt, a few retrieved passages and the question) and returns about 400 tokens. Take example prices of $3 per million input tokens and $15 per million output tokens. These are placeholders for the arithmetic, not a quote from any provider.

  • Input: 1,500 × $3 ÷ 1,000,000 = $0.0045
  • Output: 400 × $15 ÷ 1,000,000 = $0.0060
  • Per request: $0.0105
  • Per day: 1,000 × $0.0105 = $10.50
  • Per month (30 days): $315

With a 25% buffer for retries and growth, budget about $395. The output is only 400 of the 1,900 tokens in each call, but it makes up 57% of the cost. That is the effect of the higher output price.

Five steps to estimate monthly LLM API cost: measure tokens, find prices, cost one request, multiply by volume, add a margin
Prices change often, so check the current rates before you commit to a budget.

Where the estimate goes wrong

  • Conversation history. In a multi-turn chat you usually send the earlier messages again. A 10-turn conversation does not cost ten single requests; it costs closer to the sum of an ever-growing input. Estimate with the average conversation length, not a single message.
  • Reasoning tokens. Models that think before answering may bill the hidden reasoning as output tokens. Check how your provider counts them and test with real prompts.
  • Tool calls and agents. An agent that makes several model calls per task multiplies the figure. Estimate calls per task, then tokens per call.
  • Retries and failures. Failed or repeated calls usually still cost something. A buffer covers this.
  • Image and file inputs. These are converted to tokens at rates that vary by provider and size.

Ways to reduce the bill

  1. Use a cheaper model where it is good enough. Route simple classification or extraction to a small model and keep the large one for hard questions. Compare current prices in the LLM pricing comparison.
  2. Cache repeated prefixes. Several providers offer prompt caching, where a long, unchanging prefix such as a system prompt or reference document is billed at a reduced rate on later calls. It helps most when the same context is reused many times.
  3. Batch non-urgent work. Many providers discount asynchronous batch processing, often by around half, in exchange for a slower turnaround.
  4. Trim the prompt. Remove boilerplate, send only the most relevant retrieved passages and summarise old history instead of resending it.
  5. Cap the output. Set a maximum output length and ask for concise answers.

Use ranges, not a single number

Run the calculation for a low, typical and high scenario, and for a busy day as well as an average one. If the high case is unaffordable, find out before launch, not on the first invoice. The LLM API cost calculator takes tokens and daily volume and gives the per-call and monthly figures, with prices kept up to date with a visible "last verified" date.

Frequently asked questions

Why is output more expensive than input?

Generating each output token requires a separate pass through the model, while input tokens can be processed in parallel. The price reflects that difference in compute.

How many tokens is 1,000 words?

Roughly 1,300 to 1,500 tokens for typical English prose. Code and other languages vary, so measure your own text.

Do I pay for the system prompt every time?

Yes, it is input on every request unless your provider's caching reduces the rate for the repeated part.

How often do prices change?

Often. Models are released, repriced and retired regularly, so recheck prices before each budgeting cycle.