LLM API Cost Calculator

Token prices per million sound meaningless until you multiply them by real traffic. This tool takes your average prompt and completion size, your call volume and a model rate, then returns cost per call, per month and per year. It also separates cached input from fresh input, because that single ratio often moves a bill by more than switching models does. Prices are yours to enter, so the math stays correct when providers change their lists.

Below the calculator you will find the per-call formula with two fully worked examples, a benchmark table for five common workloads, and the four prompt habits that most often turn a cheap prototype into an expensive product.

Result:

Cost is priced per million tokens on both sides. Cached input is the share of the prompt prefix that providers bill at the discounted rate; leave it at 0 for a worst-case estimate. Check current prices on the provider's pricing page before budgeting.

How the LLM API Cost Calculator Works

Every call is two meters running at different rates: one for the tokens you send, one for the tokens the model writes back. Output usually costs five to ten times more per token, so the cheaper side is rarely the one that surprises you.

The formula:

Cost per call = (fresh input ÷ 1,000,000 × input price) + (cached input ÷ 1,000,000 × cached price) + (output ÷ 1,000,000 × output price)

Then monthly cost = cost per call × calls per day × days per month.

Worked example, using a mid-tier rate of $1.25 input and $10.00 output per million tokens, with 1,200 input and 400 output tokens per call and 5,000 calls a day:

Notice that output is 25% of the tokens but 73% of the bill. Now cache 60% of the input at $0.13 per million: fresh input falls to 480 tokens and costs $3.00 a day, cached input costs $0.39 a day, and the daily total drops to $23.39, roughly $702 a month. Shrinking the answer from 400 to 250 tokens instead saves about $9 a day, which is a larger cut. Run both levers before you renegotiate with your vendor.

Cost Benchmarks by Workload

Monthly cost at $1.25 input and $10.00 output per million tokens, 30 days, no caching:

WorkloadTokens in / outCalls per dayMonthly cost
Prototype, single user1,000 / 500200$3.75
Small app, early users1,000 / 5002,000$37.50
Support bot with history4,000 / 3005,000$1,200.00
Document summarizer15,000 / 8001,000$802.50
Content generator2,000 / 2,00010,000$6,750.00

The middle row is where most early products land, and it is often ten times budget. Long conversation history raises input tokens quietly; a support bot carrying four thousand tokens of context per call pays for that context on every single message.

Common Usage

Why This Number Deserves a Spreadsheet, Not a Guess

Token spend has no natural ceiling. It grows with usage, with history length and with retries, and each of those three expands for reasons your bill sees but your dashboard does not. A support bot priced at 8 cents per conversation today can quietly become 30 cents once users start asking follow-ups, because each follow-up resends the transcript.

The practical consequence is that you need a per-call cost you can actually defend, measured from logs, not from the first sample message. Then you can put a number on the business decision: is a subscription at $12 a month still profitable when the heavy users average 45 cents of API spend? This page answers the cost half of that question. The other half is how often each user calls you.

Mistakes That Inflate LLM Bills

Measuring the demo, not the data. The first prompt you test is short and clean. Production prompts include system instructions, tool schemas, retrieved context and prior turns. Measure a sample of real requests over a week and use the average, not the smallest case.

Ignoring retries and repairs. Each failed parse or tool error costs a full call. A pipeline with a 1.2 calls per task ratio is 20% more expensive than the price sheet implies.

Assuming caching is automatic. Cache discounts usually require a stable prefix above a minimum length, and they expire when unused. An unpredictable prompt layout throws the discount away on most calls.

Ignoring the long-context surcharge. Many models charge a higher or doubled input rate once a request passes a threshold such as 128K tokens. A single large document can cost more than a hundred small ones.

How Token Spend Compares With Other Infrastructure Bills

Teams often ask whether API spend is reasonable in absolute terms. The useful comparison is not with a rival model but with the rest of the hosting stack. A small web app might spend $25 a month on a database, $20 on object storage and $0 on compute within a free tier, and then $800 a month on inference. That imbalance is normal when the product is the model call, but it changes what you can charge: a $9 monthly plan stops making sense the moment heavy users average more than a few dozen cents in tokens.

The second comparison is against the alternative. For low volume — say under two hundred calls a day — a flat chat subscription on a provider's consumer plan can be cheaper than paying per token, as long as nobody needs programmatic access. Once your traffic comes from a server or reaches thousands of calls a day, seat-based pricing stops scaling and per-token cost becomes the real control point.

Notice too how quickly small prompt decisions compound. Trimming 200 tokens from the prompt of a call that runs 5,000 times a day removes a million tokens a day, which at $1.25 per million is $37.50 a month and $450 a year. Removing 200 tokens from a prompt that runs 500 times a month saves $1.50 a year. The same edit is worth three hundred times more or less depending on where it lands, which is why the traffic field matters as much as the token field.

Where This Estimate Stops

This models per-token text pricing only. It excludes image and audio inputs, embedding calls, fine-tuning charges, batch discounts, regional or negotiated rates, and any minimum commitments. Prices change often and the newer and larger models usually cost more, not less, so enter today's rates rather than a number you remember. The result is a planning estimate, not an invoice reconciliation.

Frequently Asked Questions

How do I count tokens without an SDK?

For English, four characters or about three quarters of a word per token is a decent rule, so 750 words lands near 1,000 tokens. At $1.25 per million input tokens, one cent buys roughly eight thousand tokens, about six thousand words. Expect a 10 to 20 percent error.

Why do monthly bills run higher than this calculator predicts?

Usually because calls are not one-shot. Chat and agent requests resend the system prompt and all prior turns, so average input grows with each exchange. If a conversation averages six turns, prompt tokens roughly triple across it. Use token averages measured from logs.

Can I cut output charges with a max token cap?

A cap limits the ceiling, not the price of tokens you generate. The real lever is shorter, more constrained answers: shorter field names in JSON output, a one-paragraph response rule, or a template the model fills in rather than prose it invents.

Is cached input billed at the same rate as fresh input?

No. Repeated prompt prefixes are billed at a steep discount, often around one tenth of the standard input rate, above a minimum length. Set the cached share here to see how much of your bill depends on keeping that prefix identical.

What does a long system prompt add to the bill?

Every call pays for it. Adding 1,500 tokens of policy text to a call with 1,000 input and 500 output tokens raises input spend by 150% on that call. At 100,000 daily calls and $1.25 per million input tokens that is about $5,625 a month for the extra text alone.

Does a model that is 80% cheaper cut my cost by 80%?

Rarely. Cheaper models often need longer instructions, more retries and repair passes on malformed output, and each of those is another call. The saving is real but usually smaller than the price ratio suggests; model the retry count rather than assuming it stays at one.