How It Works
Every time you call an AI model through its API, you are billed for two things: the tokens you send in (your prompt, plus any files, images converted to tokens, or conversation history) and the tokens the model generates back (its answer). Providers publish their prices per one million tokens, separately for input and output, and output tokens almost always cost several times more than input tokens. The formula behind every number on this page is simple: divide your input tokens by one million and multiply by the input price, do the same for output tokens and the output price, then add the two together. That gives you the cost of a single request. Multiply by your daily request volume for the daily cost, by thirty for the monthly estimate, and by three hundred sixty-five for the yearly one.
What makes costs hard to predict in practice is that you rarely know your exact token counts in advance. A "token" is not a word — it is the chunk of text the model's tokenizer produces, and it can be a whole word, part of a word, a number, or a single punctuation mark. As a rule of thumb, one hundred English words work out to roughly one hundred and thirty tokens, or about four characters per token. This calculator gives you two ways to handle that uncertainty. If you already know your token counts — from a previous API response's usage field, from your provider's dashboard, or from a tokenizer tool — type them straight in. The fields even accept simple arithmetic, so you can write expressions like 2000+4*250 when your prompt is built from repeated parts. If you do not know your counts, paste your actual prompt text and the built-in estimator will count for you. The estimator is a heuristic calibrated against the real tiktoken tokenizers: on five hundred varied sample texts covering prose, code, numbers, and mixed content, its average error was about five percent, which is close enough for budgeting even though it is not exact enough for invoicing.
The model dropdown carries list prices collected in October and November 2026 from the official OpenAI, Anthropic, and Google pricing pages: GPT-4o at $2.50 input and $10.00 output per million tokens, GPT-4o mini at $0.15 and $0.60, GPT-4 Turbo at $10.00 and $30.00, Claude 3.5 Sonnet at $3.00 and $15.00, Claude 3 Haiku at $0.25 and $1.25, Gemini 1.5 Pro at $1.25 and $5.00, Gemini 1.5 Flash at $0.075 and $0.30, and hosted Llama 3.1 (70B) at roughly $0.88 each way. Because prices move — providers cut them regularly as hardware gets cheaper — the page labels every figure "prices as of Nov 2026, verify with provider," and you should always confirm the current list price before signing off on a budget. The comparison table prices your exact workload on every model at once and highlights the cheapest, which is usually the fastest way to spot savings: switching a high-volume summarization job from a flagship model to a mini or flash tier can cut the bill by ten to fifty times without you changing a single line of prompt.
What counts as input and output
Input tokens include everything the model reads before it starts answering: your system instructions, the user's message, any retrieved documents you inject for retrieval-augmented generation, few-shot examples, and the full conversation history you resend on every turn of a chat. That last one surprises people — in a ten-turn conversation, the first message gets billed ten times because it is re-sent with every request. Output tokens include the visible answer plus, on reasoning models, the hidden "thinking" tokens the model generates internally, which are billed as output even though you never see them. If you use structured outputs, tool calls, or long chain-of-thought reasoning, your output side can easily dominate the bill.
Why the context-window warning matters
Every model has a context window: the maximum number of tokens it can handle in one request, counting input and output together. If your prompt plus expected answer exceeds it, the API call fails or your text gets silently truncated. The calculator watches your totals against the selected model's window — 128K for the GPT-4o family, 200K for Claude 3 models, up to 2M for Gemini 1.5 Pro — and warns you when you cross eighty percent or exceed it entirely. Treat that warning as a design signal: either switch to a longer-context model, or split the work with the text chunker approach described in our companion tool.
Worked Example
Imagine you run a small support desk and want an AI to draft replies. Each incoming ticket includes the customer's message and a short order history — about 1,500 tokens of input once you add your system instructions. The drafted reply averages 300 tokens. You handle 200 tickets a day. Let's price that on three models.
Start with GPT-4o mini. Input cost per request: 1,500 divided by 1,000,000 times $0.15, which is $0.000225. Output cost: 300 divided by 1,000,000 times $0.60, which is $0.00018. One request costs $0.000405 — about four hundredths of a cent. Two hundred requests a day cost $0.081, and a thirty-day month costs $2.43. That is the price of a coffee per month for an AI-assisted support desk.
Now the same workload on GPT-4o. Input: 1,500/1,000,000 × $2.50 = $0.00375. Output: 300/1,000,000 × $10.00 = $0.003. Per request $0.00675, per day $1.35, per month $40.50 — roughly seventeen times more than the mini. On Claude 3.5 Sonnet: input 1,500/1,000,000 × $3.00 = $0.0045, output 300/1,000,000 × $15.00 = $0.0045, per request $0.009, per month $54.00. The quality ladder is real — flagship models write noticeably better drafts — but so is the price ladder, and the comparison table on this page computes all of these instantly so you can weigh the trade-off with real numbers instead of gut feeling.
One more scenario shows why output pricing deserves respect. Suppose you build a document summarizer: 20,000 input tokens per report, 500 output tokens, 50 reports a day, on GPT-4o. Input per request: 20,000/1,000,000 × $2.50 = $0.05. Output: 500/1,000,000 × $10.00 = $0.005. The input side dominates here — $2.50 a day in input versus $0.25 in output — because long documents flip the usual balance. Monthly: about $82.50. Move it to Gemini 1.5 Flash at $0.075/$0.30 and the same math gives $0.0015 + $0.00015 = $0.00165 per request, $0.0825 a day, $2.48 a month. Same documents, thirty-three times cheaper. That is exactly the kind of discovery this calculator is built for.
Reading the comparison table
The table sorts every model by per-request cost for your workload and stamps the winner with a "cheapest" badge. Read the per-month column as your planning budget and the per-request column as your unit economics — the number you would plug into pricing your own product. If two models are within a few percent on price, pick on quality, speed, and context window rather than cost. If they differ by ten times or more, run a small quality test on the cheaper one first; for classification, extraction, and summarization, the cheaper tier wins far more often than people expect.
Tips and Common Mistakes
The most expensive mistake in AI budgeting is forgetting that conversation history compounds. A chatbot that resends the full transcript on every turn bills the early messages over and over. If your average conversation is twenty turns of 200 tokens each, the naive total is not 4,000 tokens — it is closer to 40,000, because turn one is sent twenty times, turn two nineteen times, and so on. Trim history, summarize it periodically, or use prompt caching where the provider discounts repeated prefixes, and re-run the numbers here with the reduced counts.
Second, do not estimate output tokens as zero "to be safe" — output is the expensive side on most models, priced three to five times higher than input per token. Reasoning models make this worse because their internal thinking tokens bill as output invisibly. A good default is to assume the answer will be twenty-five to fifty percent as long as the prompt, then measure real usage for a week and refine. This calculator's text mode uses twenty-five percent as its default output assumption for exactly this reason.
Third, remember that list prices are the starting point, not the final bill. Batch APIs typically cut every rate in half in exchange for slower turnaround. Prompt caching can discount repeated input by fifty to ninety percent. Long-context surcharges can double input prices past certain thresholds — Gemini, for example, has historically charged more beyond 128K tokens. None of those adjustments are in the base math here, so treat the result as your planning estimate and check your provider's dashboard after the first real week.
- Test the cheap tier first. For summarization, classification, and data extraction, mini/flash/haiku-class models usually match flagship quality at a tenth of the price. Spend an afternoon comparing outputs before committing to the expensive default.
- Shrink the prompt before shrinking the model. Remove redundant instructions, compress few-shot examples from five to two, and strip boilerplate from retrieved documents. Every token you cut is cut from every future request too.
- Cap max output tokens. Setting a max_tokens limit bounds your worst-case cost per request and stops runaway generations. Estimate the cap you need, then price it here.
- Cache what repeats. System prompts and document prefixes that barely change between calls are ideal for prompt caching discounts — often the single biggest lever on input-heavy workloads.
- Re-check prices quarterly. Model prices have fallen steadily for years. A workload that was too expensive on a flagship model last year may be trivially cheap on this year's mid-tier.
Finally, keep the estimate honest: this tool runs entirely in your browser, your pasted text never leaves your device, and the numbers are planning estimates — your provider's usage records are the final source of truth for billing. Use the calculator to compare options and set budgets, then verify against one real invoice and adjust.