AI & Prompts

AI Cost Calculator: Accurately Estimate Your LLM API Spend

Project monthly LLM spend across models before you ship.

This AI cost calculator estimates what an LLM feature will cost per request and per month. Enter input and output tokens per call, the number of calls, and pick a model — GPT-class, Claude, or Gemini — and it multiplies out the per-million-token pricing so you can compare models before you commit. Output tokens usually cost three to five times more than input tokens, which is where most budget surprises come from.

Cheapest / month

$90

Most expensive / month

$756

ModelPer requestPer dayPer month
OpenAI GPT-5 mini$0.001500$3$90
Google Gemini 2.5 Flash$0.001860$3.72$111.6
Anthropic Claude Haiku$0.003360$6.72$201.6
OpenAI GPT-5$0.007500$15$450
Google Gemini 2.5 Pro$0.007500$15$450
Anthropic Claude Sonnet$0.0126$25.2$756

Prices are per million tokens from published list pricing and are a planning estimate.

Cutting LLM Cost and Latency

Seven levers ranked by payoff, model-routing patterns, and a realistic 100% → 11% cost walkthrough.

One email, no spam, unsubscribe any time.

About this tool

Token pricing is quoted per million tokens, which makes it hard to reason about real monthly bills. Enter your request volume and average input and output token counts, and this calculator shows per-request, daily and monthly cost across the major model families side by side.

How LLM pricing works

You pay separately for input tokens (your prompt, system message and any retrieved context) and output tokens (the completion). Output is typically three to five times more expensive, so verbose responses dominate the bill.

How to reduce AI API costs

Trim system prompts, cap max output tokens, cache repeated context, and route simple requests to a smaller model. Reserving the flagship model for the requests that genuinely need it usually cuts spend by more than half.

How LLM pricing actually works

Providers bill per million tokens, priced separately for input (your prompt, including system message, retrieved context and conversation history) and output (what the model generates). A token is roughly four characters or three-quarters of a word in English, so 1,000 tokens is about 750 words. The cost of one request is (input tokens ÷ 1,000,000 × input price) + (output tokens ÷ 1,000,000 × output price). The trap is that the input grows silently: every turn of a chat resends the whole conversation, so turn ten costs many times what turn one did even though the user typed the same amount.

The three levers that actually reduce spend

First, model routing: send the easy 80% of traffic to a small cheap model and escalate only what fails a confidence check. Small models are commonly 10–30× cheaper than frontier models and are indistinguishable on classification, extraction and short-form generation. Second, prompt caching: most providers now discount repeated prefixes by 75–90%, which is transformative for long system prompts and retrieval context — put the stable content at the front of the prompt so it can be cached. Third, output discipline: cap max_tokens, ask for JSON or a short structured answer instead of prose, and stop paying for a polite preamble on every one of a million calls.

Estimating a realistic monthly bill

Take your daily active users, multiply by requests per user per day, then by 30. Multiply by the per-request cost from the calculator and add 20–30% for retries, evaluation runs, background jobs and development traffic — which routinely accounts for more spend than anyone budgets. Then model a 10× traffic spike: if that number would be unacceptable, put a hard spend limit at the provider and a per-user rate limit in your application before you launch, not after the invoice arrives.

Retrieval and context length

RAG feels free but is pure input cost. Stuffing ten 800-token chunks into every prompt adds 8,000 input tokens per call — at frontier-model pricing that alone can dominate the bill. Retrieve fewer, better chunks, rerank before you send, and measure whether chunks six through ten ever change the answer. Similarly, a large context window is a capability, not an instruction: paying to send 100,000 tokens when 4,000 would do is the most common form of LLM overspend.

Fine-tuning versus prompting, on cost grounds

Fine-tuning has a one-off training cost and usually a higher per-token inference price, but it lets you drop a long few-shot prompt, which can cut input tokens by thousands per call. It pays back when volume is high and the task is narrow and stable. Below roughly 100,000 calls a month, a well-cached prompt on a smaller model is almost always cheaper and far easier to change.

Indicative LLM pricing per million tokens

Model tierInputOutputBest for
Frontier (GPT-class, Claude Opus)$3 – $15$15 – $75Complex reasoning, agents, code
Mid-tier (Sonnet-class, GPT mini)$0.50 – $3$2 – $15General production workloads
Small / fast (Haiku, Flash, nano)$0.05 – $0.50$0.20 – $2Classification, extraction, routing
Embeddings$0.01 – $0.13n/aSearch and retrieval indexes
Provider prices change often — always confirm against the provider's current pricing page before committing a budget.

Token rules of thumb

ContentApproximate tokens
1 token≈ 4 characters / 0.75 words
100 words of English≈ 133 tokens
1 page of text (500 words)≈ 667 tokens
A typical system prompt200 – 1,500 tokens
One RAG chunk300 – 1,000 tokens
A 50-page PDF≈ 33,000 tokens

How to use AI Cost Calculator

  1. 1

    Estimate tokens

    Roughly 1 token ≈ 4 characters of English. Paste a representative prompt into the token counter if you want a tighter number.

  2. 2

    Enter volume

    Add requests per day or per month, including retries and background jobs.

  3. 3

    Compare models

    The table shows projected monthly cost side by side so you can see what a model swap is actually worth.

  4. 4

    Budget with headroom

    Add 20–30% for retries, evaluation runs and traffic spikes.

Example input

1,200 input + 400 output tokens · 50,000 requests/month

Expected output

≈ $X/month per model, compared across GPT, Claude and Gemini tiers

Best practices

  • Model cost per request, then multiply by realistic monthly volume — averages hide the tail where cost actually lives.
  • Separate input and output tokens: output is typically 3–5× more expensive, so trimming verbose responses beats trimming prompts.
  • Cache system prompts and retrieved context where the provider supports it; repeated prefixes are the single biggest avoidable spend.
  • Route by difficulty — use a small model as the default and escalate only when confidence is low.
  • Re-check pricing quarterly and set a hard monthly spend cap at the provider before you scale traffic.

AI Cost Calculator — Why it matters

LLM spend scales with usage, not with headcount, so a successful launch can multiply your bill overnight if nobody modelled it first.

Knowing cost per request lets you price your own product with a real gross margin instead of a guess.

Related free & paid tools

Tool nameTypeKey featuresLink
OpenAI pricingFreeCurrent per-token rates for every modelVisit
HeliconeOfferFreemiumPer-request LLM cost and latency observabilityVisit
LangfuseOfferFreemiumOpen-source tracing with cost attributionVisit
OpenRouterOfferFreemiumOne API across providers with live price comparisonVisit

Some links marked Offer are partner links. They cost you nothing extra and help keep these tools free.

Related tools

Frequently asked questions