LLM cost calculator
Estimate monthly and annual API spend for a model from your average prompt and reply length, how many requests you make a day, and how many days a month you run.
LLM API cost is the number of tokens you send and receive, multiplied by the model’s price per token. This calculator takes your average input and output tokens per request, requests per day and working days per month, and prices them per million tokens: monthly cost = (monthly input tokens ÷ 1M × input price) + (monthly output tokens ÷ 1M × output price). Output tokens usually cost several times more than input tokens, so long answers can dominate the bill even when prompts are larger.
Calculator
LLM Cost Calculator
Pricing reference (per 1M tokens)
| Model | Input | Output |
|---|---|---|
| OpenAI GPT-4o | $2.50 | $10.00 |
| OpenAI GPT-4o-mini | $0.15 | $0.60 |
| Anthropic Claude Sonnet | $3.00 | $15.00 |
| Anthropic Claude Haiku | $0.25 | $1.25 |
| Google Gemini Pro | $1.25 | $5.00 |
| AWS Bedrock Claude | $3.00 | $15.00 |
Results
Select a model and enter your usage parameters, then click “Calculate Results” to see your LLM costs.
Method
How the LLM cost calculator works
The calculator applies five steps, in this order, to the numbers you enter:
- Monthly requests = requests per day × working days per month (22 if you leave it blank).
- Monthly input tokens = monthly requests × average input tokens per request.
- Monthly output tokens = monthly requests × average output tokens per request.
- Monthly cost = input tokens ÷ 1,000,000 × input price + output tokens ÷ 1,000,000 × output price.
- Annual cost = monthly cost × 12, and cost per request = monthly cost ÷ monthly requests.
Prices come from the reference table under the form, per million tokens. Provider prices change, so check the model’s current price page and adjust if it has moved.
Example
Worked example: a support assistant on GPT-4o
Take an assistant that sends about 1,500 input tokens (system prompt, conversation and retrieved help articles) and gets about 500 output tokens back, 1,000 times a working day, 22 days a month. At the calculator’s GPT-4o prices of $2.50 input and $10.00 output per million tokens:
GPT-4o, 1,500 in / 500 out, 1,000 requests a day
- Monthly requests = 1,000 × 22 = 22,000
- Input tokens = 22,000 × 1,500 = 33,000,000
- Output tokens = 22,000 × 500 = 11,000,000
- Input cost = 33 × $2.50 = $82.50
- Output cost = 11 × $10.00 = $110.00
- Monthly cost = $192.50; annual = $2,310.00
- Cost per request = $192.50 ÷ 22,000 ≈ $0.0088
The same workload on GPT-4o-mini ($0.15 / $0.60 per million) comes to 33 × $0.15 + 11 × $0.60 = $11.55 a month.
How to read the result
Look at the input/output split first. Here output is a quarter of the tokens but about 57% of the cost ($110.00 of $192.50), so capping reply length is the first lever. Then look at cost per request: multiply it by the number of requests a user or feature makes to see what each one costs you. If the gap between models is large, as it is above, test whether the smaller model is good enough for some of the traffic.
Common mistakes
- Counting only the user’s message as input. The system prompt, chat history and retrieved documents are sent on every call and are often most of the tokens.
- Using calendar days for a service that runs seven days a week. Set working days to 30 or 31 for always-on traffic.
- Planning on the average only. Long conversations and large documents push the tail up, so run a second scenario with your 90th-percentile token counts.
- Forgetting retries, agent loops and tool calls, each of which is a separate billed request.
When to use a related tool
The annual figure here is one part of your operating cost. Put it into the AI ROI calculator to see payback on the whole project, or into the AI automation ROI calculator as part of the tool’s monthly cost. Running more than one model in production? See how an enterprise AI platform brings cost tracking, guardrails and AI compliance into one place, and how LLM observability attributes measured cost to each agent, feature and user.
FAQ
Frequently asked questions
How do LLM pricing models work?
Most LLM APIs charge per token, priced per million. A token is a fragment of text, roughly three-quarters of an English word on average. Input tokens (your prompt and context) and output tokens (the reply) are priced separately, and output usually costs more. Some providers also discount batch requests and cached prompt prefixes.
Why do output tokens cost more than input tokens?
Output tokens cost more largely because the model generates them one at a time, while input tokens are processed together in one pass. In this calculator’s price table the output price is four to five times the input price for every model listed, so trimming answer length often saves more than trimming the prompt.
How can I reduce LLM token costs in production?
Cut the tokens you pay for and the price you pay per token. Route simple requests to a smaller model, cache static system prompts where your provider supports it, set a max_tokens limit on replies, shorten retrieved context, and reuse answers to repeated questions. Measure cost per request before and after each change.
How do I estimate tokens per request before launch?
Count them on real examples. Run 20 to 50 representative prompts through your provider’s tokenizer or API, including the system prompt and any retrieved documents, and record input and output token counts. Use the average in the calculator, and the 90th percentile as a second scenario to see how sensitive the bill is.
What costs does this calculator leave out?
It covers per-token API charges only. It leaves out embeddings for retrieval, fine-tuning and model hosting, retries and failed calls, batch or cached-prompt discounts, taxes, and the engineering time to build and maintain the system. Add those separately when you budget for a production deployment.
How do I track actual LLM cost once the system is live?
Record token counts on every model call and price them per model. An LLM observability platform such as Perimattic AI Suite does this from OpenTelemetry traces and rolls the cost up by agent, feature, team and user, so you can compare real spend with this estimate and set budget alerts.
Turn the estimate into measured numbers
- Free consultation
- No commitment
- Tailored to your team