Free tool · Build

LLM API Cost Calculator

Enter your input and output token counts, pick the models you want to compare, and this calculator estimates what a single call and a full month of calls would cost across today's major AI APIs. Use it to budget an app, compare providers, or sanity-check a bill.

Your prompt + context

The model's reply

Total API requests

Not sure how many tokens your prompt is? Estimate it with the token counter. Output tokens are usually the pricier half of the bill — most providers charge 3–5x more for what the model writes than for what you send.

Compare models

Approximate list prices per 1M tokens — check the provider for current rates.

Estimated cost1,000 in + 500 out · 10,000 calls/mo
ModelPer callPer month
GPT-4o miniCheapestOpenAI$0.0004$4.50
Gemini 2.x FlashGoogle$0.0004$4.50
Claude HaikuAnthropic$0.0028$28.00
GPT-4oOpenAI$0.0075$75.00
Claude SonnetAnthropic$0.010$105.00

Estimates use approximate 2026 list prices and ignore discounts like prompt caching or batch pricing, which can cut the input side sharply. Confirm current rates with each provider, and see the model comparison for context windows and strengths.

How AI API pricing works

When you call an AI model through its API, you are not billed per request or per minute — you are billed per token. A token is a short chunk of text, roughly four characters or three- quarters of a word in English. Every call has two token totals that are priced separately:

  • Input tokens— everything you send: the system prompt, any documents or context, the conversation history and the user’s message.
  • Output tokens — everything the model writes back in its reply.

Prices are almost always quoted per 1,000,000 tokens, because a single token is worth a tiny fraction of a cent. The formula for one call is simply the input tokens times the input price plus the output tokens times the output price, each divided by a million. This calculator does exactly that, then multiplies by your monthly call volume.

The important asymmetry is that output costs more. Reading your prompt is a single efficient pass through the model, but writing a reply means running the entire network once for every token it generates, in sequence. That extra work is why providers price output tokens roughly three to five times higher than input. Practically, the length of the answer matters far more to your bill than the length of the question.

Reading the numbers: per-call vs per-month

Look at any single result in the calculator and the per-call cost looks trivial — often a fraction of a cent. That is why it is so easy to underestimate an AI bill. The number that actually matters is the per-month figure, because production apps make a lot of calls.

Consider a call with 1,000 input tokens and 500 output tokens on a mid-tier model priced at roughly $3 input and $15 output per million. Each call costs about $0.003 for input plus $0.0075 for output, around $0.01 total. Barely noticeable. But run that 100,000 times a month and it is $1,050. Run it a million times and it is over ten thousand dollars. The per-token price never changed — only the volume did.

This is also why small prompt changes scale. If you trim a bloated system prompt from 2,000 tokens to 500, you save 1,500 input tokens on every single call. That is invisible on one request and material across millions. The same logic applies to context you resend each turn in a chat app. Before you optimise, it helps to know your exact counts — our token counter shows how any prompt breaks down.

Prompt caching and batch discounts

The list prices you compare here are effectively a ceiling. Most major providers offer two big discounts that this calculator does not model, because they vary by provider and setup — but you should know they exist.

Prompt caching

Many applications send the same large chunk of text on every call: a long system prompt, a style guide, a set of few-shot examples, or a reference document. Prompt caching lets the provider store that unchanging prefix and skip reprocessing it, charging a heavily reduced rate — commonly around 90% off the normal input price — whenever it is reused. If a big fraction of your input is identical across calls, caching can slash the input side of your bill.

Batch processing

When you do not need an instant answer — think overnight classification, bulk summarisation, or dataset labelling — many providers offer a batch mode that returns results within a longer window (often up to 24 hours) for roughly 50% off both input and output. It is a large saving for any workload that is not user-facing in real time.

Exact discount rates, eligibility and how caching is billed differ by provider and change over time, so confirm the specifics before you rely on them. The takeaway: if your real usage is dominated by repeated context or offline jobs, your effective cost can be well below the sticker price shown above.

A worked example: a support chatbot

Suppose you run a customer-support assistant that handles 2,000 conversations a day, and each conversation averages three back-and-forth turns, so about 6,000 model calls a day, or roughly 180,000 calls a month. Each call sends a system prompt plus recent history — say 1,500 input tokens — and the model replies with about 400 output tokens.

On a mid-tier model at ~$3 input / $15 output per million:

  • Input per call: 1,500 ÷ 1,000,000 × $3 = $0.0045
  • Output per call: 400 ÷ 1,000,000 × $15 = $0.0060
  • Per call: about $0.0105
  • Per month: $0.0105 × 180,000 ≈ $1,890

Now switch the easy, high-volume turns to a small model at ~$0.15 input / $0.60 output. The same call drops to about $0.0005, or roughly $90 a month — more than a 20x reduction. Add prompt caching on that fixed system prompt and it falls further still. The point is not the exact figures, which depend on current pricing, but the shape: model choice and prompt size dominate, and the calculator lets you test each lever before you build.

Practical ways to cut your bill

  • Match the model to the task. Reserve premium reasoning models for genuinely hard work and route routine calls — classification, extraction, simple replies — to a cheap, fast model. This is usually the single biggest saving. Our AI model comparison helps you weigh capability against price.
  • Cap the output.Because output is the expensive half, set a sensible maximum length and ask for concise answers. “Reply in two sentences” can cost a fraction of an open-ended request.
  • Trim your prompts. Remove filler, redundant instructions and examples you do not need. Every token you cut is saved on every call.
  • Summarise conversation history. In a chat app, replace old turns with a short running summary instead of resending the entire transcript each time.
  • Use caching and batch mode. If a large prefix repeats across calls, enable prompt caching. If work can wait, run it through batch processing for a further discount.

Frequently asked questions

How much does the ChatGPT, Claude or Gemini API cost?

AI APIs bill per token, not per message, with separate rates for input and output. As a rough 2026 guide, small, fast models cost around $0.15 per million input tokens and $0.60 per million output, mid-tier models land near $2.50–$3 input and $10–$15 output, and premium reasoning or flagship models can reach $15 input and $60–$75 output. These are list prices and change often, so always confirm the current rate on the provider's pricing page before budgeting.

Why are output tokens more expensive than input tokens?

Generating text is more computationally expensive than reading it. The model reads your whole prompt in one efficient pass, but it produces the reply one token at a time, running the full network for each new token it writes. That sequential generation is slower and heavier, so providers price output tokens roughly 3–5x higher than input. It is why capping response length is one of the fastest ways to cut a bill.

Are these prices exact?

No. The prices in this calculator are approximate 2026 list prices, included so you can compare models at a glance. Real pricing shifts frequently, varies by usage tier and region, and is often reduced by prompt caching or batch discounts this tool does not model. Treat the numbers as a planning estimate, then confirm the exact rate with OpenAI, Anthropic or Google before you commit.

What is prompt caching?

Prompt caching lets a provider store a chunk of your prompt — typically a long, unchanging system prompt or a shared document — so it does not have to reprocess those tokens on every call. When the cached portion is reused, you are billed a heavily discounted rate for it, often around 90% off the normal input price. It is most valuable when many requests share the same large preamble.

How do I estimate how many tokens my prompt is?

A quick rule for English is that one token is about four characters, or roughly ¾ of a word, so 1,000 words is around 1,300–1,400 tokens. Code, JSON and non-English text use more tokens per character. For an accurate count, paste your prompt into our free token counter, then enter the input and output figures here.

Is this calculator free, and does it send my data anywhere?

It is completely free and runs entirely in your browser. The token counts and call volumes you type are used only for the on-page arithmetic — nothing is uploaded, logged or stored, and no prompt text is ever required. You can even use it offline once the page has loaded.

From the makers of these tools

Actually understand AI, one minute a day.

Scroll: Learn AI turns everything behind these tools into bite-sized lessons and quizzes. Free on iOS, Android coming soon.

Download on theApp Store
Coming soon toGoogle Play