Before you ship an AI feature, know what it costs to run. Enter your tokens per request and your volume and this estimates the monthly and annual API bill — including the input-versus-output split that catches most teams out.
Rates are illustrative — enter your provider’s live token price for an exact figure.
What this free tool is great for: a quick, one-off job with no signup — it runs entirely in your browser, so nothing leaves your device and there's nothing to manage.
Its honest limit: it estimates a single scenario from rates you enter — it won't track your real usage, watch the bill climb as traffic grows, or help you actually build and optimise the feature behind it.
An AI feature feels free while you're prototyping — a few cents here and there. Then it ships, real traffic hits it, and the invoice arrives. The jump isn't a mystery once you see the maths: your cost is simply tokens times price times volume, and all three quietly scale together as you grow.
Only three things move your bill: the tokens you send (your prompt, context and any retrieved documents), the tokens the model generates (the answer), and how many requests you run. Fatten any one — a bigger system prompt, a chattier model, more users — and the cost rises in lockstep. The calculator above lets you flex each so you can see which one is actually driving your number.
Here's the part most teams miss: providers typically charge several times more for output tokens than for input tokens. A long, rambling answer costs more than a long, detailed question. That's why the tool shows what share of each request is output — if it's most of your cost, the highest-leverage fix isn't a cheaper model, it's a shorter, more constrained answer.
Cap the output. Set a max length and ask for concise answers; you lose less quality than you'd expect. Right-size the model. Reserve the frontier model for the hard 20% and route the rest to a smaller, cheaper one. Cache and retrieve. Don't re-prompt for things you already computed; store results and pull in context instead of stuffing everything into every call. Trim the prompt. Long system prompts and bloated context get paid for on every single request. Batch where you can. Many providers price batched or off-peak work lower.
Knowing the unit economics before you ship spares you the nasty surprise later. Once the numbers work, the actual build — chaining prompts, adding a knowledge base, turning it into an agent — is a separate job. A platform like Dify handles that plumbing, so you're not wiring orchestration, retrieval and deployment together by hand.
Simple chat features rarely break budgets; agentic patterns do. An agent that reasons in steps, calls tools, reads results and iterates can spend ten to fifty model calls on one user request — each carrying the full system prompt and growing history. Add automatic retries on failures, self-correction loops ("check your work"), and parallel tool calls, and a single button-press fans out into hundreds of thousands of tokens. Before shipping anything agentic, estimate cost per *task*, not per call: trace one representative task, count its calls and tokens end-to-end, multiply by realistic volume. Teams that skip this step meet their architecture for the first time on an invoice.
Cut AI costs in this sequence. First, output caps — output tokens cost several times input and models ramble by default; tight max-tokens plus "be concise" instructions is free money. Second, model routing — classify requests and send the easy 80% to a model a tenth the price, reserving the frontier model for the hard 20% (we run exactly this: a premium model for articles, a budget one for translations). Third, prompt caching — providers discount repeated prompt prefixes steeply, so structure prompts with the static parts first and the caching often just happens. Fourth, retrieval discipline: send the three relevant chunks, not the whole document. Batching and off-peak processing come last — real savings, but only after the big four.
Estimates based on the happy path miss the tokens reality burns. Malformed outputs trigger retries at full price. Validation failures loop. Users rephrase when answers disappoint — same question, double spend. Timeouts on long generations bill for output you throw away. A production system's real cost per successful outcome runs meaningfully above its per-request estimate — how far above depends on your error handling, so add an explicit failure-and-retry allowance (20-40% is a sane starting band) and then measure your actual overhead once live. The calculator above prices the requests you intend; production also pays for the ones you didn't.
The only AI cost number that ultimately matters is cost per unit of business value: per active user per month, per document processed, per resolved ticket. Compute it early — even roughly — because it decides pricing and packaging while you can still change them. If serving a power user costs €4/month in tokens under a €10 flat plan, your heaviest fans are your worst customers by construction; that's how usage caps, tiered plans and credit systems get discovered *after* launch instead of designed before it. Set a per-user cost alert from day one; the distribution of usage is always more skewed than anyone expects, and the tail is where margins go to die.
A pre-launch estimate is a hypothesis; production needs live per-request token tracking, per-user cost visibility, and the ability to swap models or tighten prompts without redeploying. That's where Dify does more: an open LLM-ops platform where apps and agents are built visually, every call is logged with its token spend, and routing between models is configuration rather than code. Use this calculator to decide what to build and how to price it; run the build on rails that show you — daily, per feature, per user — whether the estimate is still true. A final honest note: model prices and capabilities shift fast enough that any cost architecture deserves a quarterly review — the routing split that was optimal in January is rarely optimal by June, and ten minutes of re-checking rates against your actual traffic mix routinely finds double-digit savings hiding in defaults. Treat the review like renewing insurance: unglamorous, scheduled, and considerably cheaper than the alternative of discovering the drift on the invoice that finally makes someone look.
It's exact for the rates and volume you enter — the maths is simply tokens times price. The one variable is the token price, which changes and differs per provider, so the model presets are illustrative and every rate field is editable. Enter your provider's live price for a precise figure.
Providers charge more for tokens the model generates (output) than for tokens you send (input), often several times more. That's why this tool splits the two and shows what share of your cost is output — usually the bigger lever.
No. The calculation runs entirely in your browser; nothing is uploaded, stored or logged, and there's no signup.
Blogger, teacher or toolmaker? Put this calculator on your own page — free forever, no strings. Copy the snippet below (the credit link is appreciated and keeps the tool free):
This tool is free and runs entirely in your browser. The link above is an affiliate link: we may earn a commission if you sign up, at no extra cost to you, and it never changes our honest take.
New dossiers, cost-traps we found, and tools that earned a keep — no hype, no sponsored-disguised-as-advice. Unsubscribe anytime.