Short answer. Multiply monthly input tokens by the input price per million, add monthly output tokens at the output price, then add fixed fees. Tokens per month are requests multiplied by tokens per request, adjusted for retries and cache hits. The result is your bill; divide it by requests for the unit cost.
What this calculator answers
Most cost calculators bundle a price table. That table is often stale within a quarter, and it quietly decides which provider you are comparing. This one stores no prices at all. You supply the rates from your quote, contract or invoice, so the output describes your commercial terms rather than a vendor's marketing page.
Three numbers matter in a budget review: the monthly bill, the cost per request, and the volume at which a flat subscription overtakes metered billing. The calculator returns all three, plus the blended rate that lets you compare quotes with different input and output splits.
The distinction is practical. A price per million tokens is not a bill. The bill depends on the input-to-output mix, request count, retries, cache hits and fixed platform fees. Two teams on the same rate card can differ by an order of magnitude because one sends 20,000-token agent contexts and the other sends 800-token classifications.
If you want a calculator with a pre-filled model catalogue and dated list prices, the model-priced variant is more convenient. This page is deliberately blank because a stored price table ages badly and hides the assumptions behind the number.
Price a workload
All values are editable. No token rate is pre-filled; the flat comparison starts at an example value you can replace. Nothing is sent to a server.
The formula
Every figure is arithmetic on your inputs. There are no benchmark assumptions and no hidden rates.
- Token volume: monthly input tokens = requests × input tokens per request. The same for output.
- Retry adjustment: billed tokens = token volume × (1 + retry percentage ÷ 100).
- Input cost: uncached input tokens ÷ 1,000,000 × input price, plus cached input tokens ÷ 1,000,000 × cached price.
- Output cost: billed output tokens ÷ 1,000,000 × output price.
- Total: input cost + output cost + fixed monthly fees.
- Blended rate: variable cost ÷ billed tokens × 1,000,000. Fixed fees are excluded so the rate stays comparable across quotes.
- Unit cost: total ÷ requests, and × 1,000 for the cost per thousand requests.
Unit check. Prices are usually quoted per 1M tokens. A quote per 1K tokens converts by multiplying by 1,000, so $0.0004 per 1K is $0.40 per 1M. A quote per 1M characters is not a token price; convert characters to tokens first, at roughly four characters per token for English prose.
Worked examples
The three scenarios below use round, illustrative rates chosen for arithmetic. They are not any provider's published price. The point is the shape of the bill, not the specific number.
| Scenario | Requests | Input tokens | Output tokens | Input $/1M | Output $/1M | Monthly bill | Blended $/1M | Per 1,000 requests |
|---|---|---|---|---|---|---|---|---|
| Support assistant | 100,000 | 1,500 | 400 | $0.40 | $1.20 | $108.00 | $0.5684 | $1.08 |
| Classification | 1,000,000 | 800 | 200 | $0.15 | $0.60 | $240.00 | $0.2400 | $0.24 |
| Agent, 60% cache, 8% retries | 30,000 | 20,000 | 2,000 | $2.00 | $8.00 | $1,231.20 | $1.7273 | $41.04 |
The support assistant shows why the blended rate is not the input rate. Output is only 21% of tokens, but at three times the input price it is 44% of the bill. A budget that counts input tokens only would be 44% too low.
The classification workload is the opposite shape. A million small requests are dominated by request count, and the unit cost of $0.24 per thousand requests is the number to put into a product margin model. At that size, a per-request minimum fee matters more than the token rate.
The agent case is where estimates usually fail. Thirty thousand requests is modest, but 20,000 input tokens per request turns into 600M input tokens a month. Caching 60% of that input at a quarter of the input price, plus 8% retries, produces a $1,231 bill. Context length, not request count, is the driver.
Where the token counts come from
For a live system, use the counts the API returns rather than a guess. Plugsky follows the OpenAI response shape, so a chat completion includes a usage object with prompt and completion token totals.
curl https://api.plugsky.com/v1/chat/completions \
-H "Authorization: Bearer $PLUGSKY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "plugsky-lite",
"messages": [{"role": "user", "content": "Summarise this support ticket."}]
}'The approved base URL is https://api.plugsky.com/v1. Plugsky's public docs examples also show https://plugsky.com/v1; both base URLs return the model catalogue, but pick one per environment and keep it in configuration instead of mixing them.
For planning before launch, estimate tokens as characters ÷ 4 or words × 1.33 for English. Add the tokens consumed by tool schemas, retrieved chunks, system prompts and images, because those are billed input even though nobody typed them. On reasoning models, reserve output for internal reasoning that never appears in the answer.
A planning estimate is a ±20% number. The usage field on a completed request is the billing number. Reconcile the two monthly rather than arguing about which is right.
What to enter as a price
- Net contract rate, not list price. Apply committed-use discounts, promotional credits and rounding before entering the number. List price is a ceiling for budgeting, not the cost of the deal you signed.
- Tiered pricing. If the rate changes with volume, run the calculator once per tier and add the tier subtotals. Averaging the rates produces a number that matches no invoice.
- Cache reads. Enter the measured share of input that hits the cache and the cached rate. If the cached rate is left at zero, the model assumes free cache reads; that is only correct if the contract says so.
- Retries. Most providers bill a request that reaches the model even when the client times out, and a retried request bills again. Enter the retry share from your logs, not a guess about reliability.
- Fixed fees. Platform fees, support retainers and minimum commitments belong in the fixed field. They do not scale with tokens, but they do appear on the invoice.
- One currency. Convert quotes to a single currency before comparing. Mixing EUR list prices with USD invoices is a common source of a 10% budget miss.
What the estimate leaves out
- Taxes, VAT, payment processing and currency movement.
- Storage, egress, vector databases, observability, evaluation tooling and seat licences.
- Image, audio and video tokens, which are usually priced per unit rather than per text token.
- Batch discounts and cache-write fees; apply batch discounts to the rate first, and price cache writes separately if the contract charges them.
- Provider-side failures, rate-limit retries and queueing. These cost engineering time even when they are not billed.
- Annual prepay cash flow. The calculator is monthly; a 20% annual discount improves the monthly equivalent but requires paying twelve months upfront.
If the number is going to finance, annualise it, compare it with the last invoice, and express it as a share of gross margin per customer. A cost estimate that is not tied to a margin line tends to be treated as an IT expense rather than a product constraint.
Frequently asked questions
How is a monthly AI API cost calculated?
Multiply monthly input tokens by the input price per million, multiply monthly output tokens by the output price per million, then add any fixed monthly fees. Tokens per month are requests multiplied by tokens per request, adjusted for retries and cache hits. The total is the bill; divide it by requests for the unit cost.
Why are input and output tokens priced differently?
Input is processed in one pass, while output is generated token by token and usually costs more compute per token. That is why most providers publish two rates. A single blended rate hides the split, so this calculator keeps both rates and reports the blended result separately.
Should I use list price or my contract price?
Use the net rate you actually pay: contract, quote or last invoice, after committed-use discounts and before tax. List price is only a budgeting ceiling. If your agreement has tiers or a minimum commit, run the calculator once per tier and add the results rather than averaging the rates.
How do I convert a price per 1K tokens to a price per 1M tokens?
Multiply the per-1K price by 1,000. A quote of $0.0004 per 1K tokens is $0.40 per 1M tokens. Going the other way, divide by 1,000. Check the unit before entering a number, because a 1,000x error is the most common costing mistake in AI procurement.
How does prompt caching change the estimate?
Cached input tokens are usually billed below fresh input tokens. Enter the share of input that hits the cache and the cached rate from your contract. If you leave the cached rate at zero, the calculator models free cache reads, which overstates the saving unless your agreement says cache reads are free.
Does the calculator include retries and failed requests?
Only if you enter a retry overhead. The default is zero. Most providers bill tokens for a request that reaches the model even if your client times out, and retried requests bill again. Measure your retry share from logs and enter it as a percentage so the estimate reflects billed work rather than successful work.
Related pages
Price the workload before you pick the plan
Start on the free plan with real requests, then use your own usage numbers to choose a paid plan.
Start Free → See pricingSources
Token-counting guidance and provider billing structures were checked on the official pages below on 20 November 2026. No provider price is reproduced on this page; enter your own rate.
| Source | Page checked | Checked |
|---|---|---|
| OpenAI | help.openai.com — what are tokens and how to count them | 20 Nov 2026 |
| OpenAI | platform.openai.com/docs/pricing — input and output priced separately | 20 Nov 2026 |
| Anthropic | anthropic.com/pricing — metered API billing structure | 20 Nov 2026 |
| Plugsky | plugsky.com/pricing and plugsky.com/facts | 20 Nov 2026 |
Last checked 20 November 2026. The calculator is a planning aid, not an invoice or a quote. Plugsky's canonical plan numbers live at /pricing.