ThisCalculator

Everyday

Estimate the Cost of Running Generative AI at Scale

Updated · Standard formula, shown below

Monthly token cost 250.00 currency
Requests per month
100000 count
You entered
Average input tokens per request
1000 tokens
You entered
Average output tokens per request
500 tokens
You entered
Input price per million tokens
1 currency
You entered

Estimate the Cost of Running Generative AI at Scale

Estimate the monthly cost of a generative AI service by combining usage, model pricing, infrastructure, and operating overhead. Enter your expected request volume and token use, then compare a baseline estimate with higher-demand scenarios; you will need current provider prices or internal infrastructure costs to make the result useful.

Formula

Monthly token cost = requests × (input tokens per request × input price per million tokens + output tokens per request × output price per million tokens) ÷ 1,000,000.

  • Requests: estimated requests in one month.
  • Input tokens: average tokens sent to the model per request, including relevant instructions and conversation context.
  • Output tokens: average tokens generated per request.
  • Input and output prices: the applicable charge per million tokens, using the same currency and pricing tier.

This is a token-charge estimate, not a complete cost of running a product. Add hosting, retrieval, storage, monitoring, engineering, and other costs separately. If your provider bills per thousand tokens instead, convert the rate to a per-million-token rate by multiplying by 1,000. Check whether its published prices distinguish input, output, cached input, or other categories.

Worked Example

Using the calculator defaults:

  1. Input tokens per month: 100,000 requests × 1,000 tokens = 100,000,000 tokens, or 100 million.
  2. Output tokens per month: 100,000 × 500 = 50,000,000 tokens, or 50 million.
  3. Input charge: 100 × 1 currency unit per million = 100 currency units.
  4. Output charge: 50 × 3 = 150 currency units.
  5. Total monthly token cost: 100 + 150 = 250 currency units.

The result uses the entered prices as illustrative inputs, not a current market quote. Substitute rates from the pricing page or contract for the model and service you actually plan to use.

What You’ll Need

  • A workload estimate: requests per day or month, expected growth, peak traffic, and any seasonal pattern.
  • Measured or representative input and output token counts from realistic tasks.
  • Current pricing for the selected model and billing arrangement, including any discounts, minimums, or special token categories.
  • Known costs for compute, storage, networking, retrieval, logging, monitoring, and support.
  • A spreadsheet or calculator for scenarios and a record of the assumptions behind each estimate.

Step-by-Step

  1. Define what “at scale” means for your service. Choose a monthly planning period and forecast active users, requests per user, and expected request volume. Separate interactive usage from batch jobs, automated agents, or background processing, since their traffic patterns and service choices may differ.
  2. Measure representative token usage. Sample real or carefully constructed tasks across short, typical, and long interactions. Count all text sent to the model, including system instructions, conversation history, retrieved passages, tool results, and formatting instructions. Record generated tokens separately. A long chat can become more expensive as prior context is resent on each turn.
  3. Use a weighted average, not just the simplest prompt. Group work into task types, such as classification, summarization, and long-form generation. For each type, estimate its share of requests and average tokens. Multiply each type’s usage by its share, then combine the results. If a small fraction of tasks uses much longer context, keep that segment visible rather than hiding it in an average.
  4. Look up the exact applicable rates. Record input and output prices for the chosen model, currency, region if relevant, and billing tier. Check the pricing unit and whether cached tokens, batch processing, image or audio inputs, tool calls, or other features have separate charges. Do not assume all tokens or modalities cost the same.
  5. Calculate the variable model charge. Use the calculator for a simple single-model workload. For multiple models or task categories, calculate each segment separately and add the results. If the application retries failed requests, include the expected extra attempts; if routing sends only some traffic to a premium model, apply that model’s rate only to its share.
  6. Add non-token expenses. Include inference infrastructure if you host models yourself, plus application servers, databases, vector search or other retrieval, file storage, data transfer, observability, safety checks, and support. For self-hosting, estimate accelerator and server capacity, utilization, redundancy, and idle time; an hourly instance price alone does not represent the full operating cost.
  7. Model low, expected, and high cases. Vary request volume, context length, output length, model mix, retry rate, and peak capacity. Include growth and a buffer for uncertainty, but label the buffer as an assumption rather than a provider fee. Treat peak capacity separately from monthly average when it affects infrastructure sizing.
  8. Validate against a pilot and revise. Run a representative workload, collect actual request counts, token counts, and invoices or metering data, then compare them with the forecast. Update assumptions before committing to a scale-up. Track cost per request and cost per successful task as well as the total bill.

Common Mistakes

  • Counting only the user’s latest message and ignoring instructions, conversation history, retrieved context, or tool output.
  • Multiplying total tokens by one rate when input and output rates differ.
  • Using a price per thousand tokens as if it were per million, or mixing currencies and billing periods.
  • Assuming average usage predicts peak infrastructure needs, or that a pilot’s traffic mix will match production.
  • Leaving out retries, duplicated requests, caching behavior, storage, networking, and operational services.
  • Projecting from a single short test instead of a representative sample that includes long and unusual tasks.

Tips

  • Keep inputs, rates, and assumptions in separate spreadsheet cells so you can update prices without rebuilding the estimate.
  • Track model, task type, input tokens, output tokens, retries, and outcome in usage reports, while following your organization’s data-handling rules.
  • Estimate cost per completed task, not only per request; a cheaper request may require more retries or deliver less useful results.
  • Review whether shorter prompts, bounded conversation history, selective retrieval, or routing simpler tasks to a less costly model can reduce usage without harming requirements.
  • Compare the forecast with actual billing regularly, especially after changing prompts, features, model mix, or traffic sources.

Troubleshooting

Your estimate is far below the bill: Check for missing context tokens, output usage, retries, separate modality or tool charges, and non-token services. Confirm the invoice’s pricing unit and billing period.

The estimate changes sharply between scenarios: Identify which assumption drives the difference—often request volume, long-context frequency, output length, or model mix. Measure that factor in a pilot instead of relying on a guess.

Actual token counts exceed your sample: Sample a wider range of users and tasks, including long conversations and edge cases. Recalculate weighted averages and account for history or retrieved content that grows over time.

Monthly costs look reasonable but the service struggles at peak: Separate the monthly usage forecast from concurrency and latency requirements. Capacity, redundancy, and scaling behavior may create infrastructure costs that a token-only calculation cannot predict.

Frequently Asked Questions

What is the simplest way to estimate generative AI costs?
Estimate monthly requests and average input and output tokens, apply their separate rates, then add infrastructure and operating expenses.

Should I count system prompts and conversation history?
Yes. Include all content sent to the model on each request, not just the latest user message.

Do input and output tokens cost the same?
Not necessarily. Check the current rate for each category and any special pricing rules that apply to your usage.

How do I estimate costs for several models?
Divide requests by model or task type, calculate each segment with its own token usage and rates, then sum the segments.

Does this estimate include self-hosting?
No. Add hardware or accelerator capacity, utilization, redundancy, power and hosting arrangements, and supporting services using your own cost data.

How often should I update the estimate?
Review it when rates, traffic, prompts, model choices, or features change, and compare it with measured usage and bills on a regular schedule.

Related

Formula used
in requests | Requests per month | count | 100000 | 0
in input_tokens | Average input tokens per request | tokens | 1000 | 0
in output_tokens | Average output tokens per request | tokens | 500 | 0
in input_rate | Input price per million tokens | currency | 1 | 0
in output_rate | Output price per million tokens | currency | 3 | 0
out token_cost | Monthly token cost | currency | requests * (input_tokens * input_rate + output_tokens * output_rate) / 1000000 | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.