Skip to content
AI Price Spy
AI Price Spy
Advertise

AI PRICE SPY

API token cost: input, output, cache and retries

Compare published rates, inspect evidence and connect your tools.

Calculate the same workload with per-million-token rates, separate cache categories and retries. Check a complete example before comparing API providers.

Explanation reviewed:

Start with the billable workload

Record the exact model and channel, currency, source date and billable usage from the response or dashboard. A top-up balance is money available to spend, not the cost of a completed task. A monthly app subscription and an API invoice are different budget lines.

Use counts from accepted work plus every billed attempt. Do not substitute character length for billable tokens; the text estimate in the calculator is only an approximation.

One formula, matching categories

For rates per million tokens: cost = uncached input / 1,000,000 × input rate + output / 1,000,000 × output rate + cache reads / 1,000,000 × cache-read rate + cache writes / 1,000,000 × cache-write rate. Add separately priced tools, storage and service charges afterward.

If total input includes cached tokens, subtract cache-read and cache-write tokens before applying the uncached input rate. Some usage responses already separate these counts. Read that provider’s definitions to avoid either charging the same tokens twice or subtracting them twice.

A complete illustrative calculation

Example rates, not a current provider offer: input USD 0.30/M, output USD 1.20/M, cache read USD 0.03/M. With 1,000,000 total input tokens, including 400,000 cache reads, and 200,000 output tokens, the estimate is 0.60 × 0.30 + 0.40 × 0.03 + 0.20 × 1.20 = USD 0.432.

Without those cache hits the same token totals cost USD 0.54. If two identical attempts are both billed, USD 0.432 × 2 = USD 0.864. Real retries may have different usage, so sum their actual records rather than assuming every retry is identical.

Check the conditions before choosing the cheaper row

Confirm whether a rate already includes a channel multiplier, a long-context tier, batch discount or time-of-day offer. Apply a multiplier once. Compare the same currency; do not silently treat internal credits or CNY as USD.

Cache creation and retrieval can have different prices and expiry rules. Also check minimum top-up, payment fees, refund conditions and whether tool calls or reasoning tokens are charged separately. Unknown conditions stay unknown.

Reconcile the estimate with the invoice

Keep a small table with task, model/channel, uncached input, cache categories, output, actual billed amount and accepted result. Compare totals with the dashboard for the same period, then explain any difference.

The model-quote calculator below uses recorded input and output rates and excludes cache, tool charges and extra fees. Use the full formula for those categories. No account access, live invoice or API request is performed by this guide.

Official references