AI Token Cost Calculator

Estimate the token cost of a chatbot, coding agent, document workflow, or other AI application. Enter your own current per-million-token prices and expected usage. Compare workloads by changing token counts and prices without sending prompts or calling a model API.

Inputs

Instant calculation

Required
Use your expected daily request count.0 ≤ x ≤ 1000000000; Δx = 1; x ∈ ℤ
Include uncached input, cache reads, and cache writes. Each input token is assigned to exactly one of those three billing buckets.0 ≤ x ≤ 1000000000; Δx = 1; x ∈ ℤ
The portion of total input billed at your cache-read rate. Exclude cache writes.0 ≤ x ≤ 1000000000; Δx = 1; x ∈ ℤ
Include separately billed reasoning or thinking tokens in the output total when your provider bills them as output.0 ≤ x ≤ 1000000000; Δx = 1; x ∈ ℤ
Enter the applicable published rate in your chosen currency. No live model price is supplied.currency / 1M tokens0 ≤ x ≤ 1000000; Δx = 0.001
Use the cache-read price for your model and processing tier, in the same currency.currency / 1M tokens0 ≤ x ≤ 1000000; Δx = 0.001
Use the output price for your model and processing tier, in the same currency.currency / 1M tokens0 ≤ x ≤ 1000000; Δx = 0.001
A 30-day estimate is requests per day multiplied by exactly 30, not a calendar-month forecast.days1 ≤ x ≤ 366; Δx = 1; x ∈ ℤ
Optional. These tokens are already included in total input and are separate from cache reads. Leave at zero when cache creation has no separate rate.0 ≤ x ≤ 1000000000; Δx = 1; x ∈ ℤ
Optional. Enter the full cache-write token price, not a surcharge or multiplier. This replaces the uncached price for cache-write tokens.currency / 1M tokens0 ≤ x ≤ 1000000; Δx = 0.001

Result

Instant calculation

Estimated cost per request
0 same currency
Estimated cost per day
0 same currency
Estimated cost for entered days
0 same currency
Requests for entered days
30,000
Uncached input tokens per request
2,000
Uncached input cost per request
0 same currency
Cache read cost per request
0 same currency
Cache write cost per request
0 same currency
Output cost per request
0 same currency

How to use this calculator

Enter requests per day and the average total input and output tokens per request. Total input includes cache reads and cache writes; output should include billed reasoning tokens where applicable.

Copy applicable per-million-token prices from your provider for one model, processing mode, context tier, and currency. The initial zero prices are placeholders. If cache writes have their own price, enter their token count and full write price separately.

Choose the number of days and review the daily and period estimates alongside the four token-cost buckets. Use actual usage logs to refine your averages, then add non-token charges separately.

Formula

Uncached input = total input − cache reads − cache writes. Cost per request = (uncached input × input price + cache reads × read price + cache writes × write price + output × output price) ÷ 1,000,000. Daily cost = cost per request × requests per day. Period cost = daily cost × entered days.

Worked example

For 1,000 daily requests with 2,000 input tokens each, including 1,000 cache-read tokens, and 500 output tokens: input at 2, cache reads at 0.20, and output at 10 per million tokens cost 0.0072 per request, 7.20 per day, and 216 over 30 days in the entered currency. These are illustrative prices, not a model quote.

How much does prompt caching save on an API workload?

Compare the same workload with no cache, cache reads, and cache writes. All USD rates below are illustrative, not current provider prices. Replace them with the rates for your model, account, currency, and service tier.

1. Keep the requests and output fixed

Enter 1,000 requests per day, 30 days, 2,000 total input tokens per request, and 500 output tokens per request. Use these example prices per million tokens: uncached input $2.00, cache read $0.20, cache write $2.50, and output $10.00.

For the no-cache baseline, set cache reads and writes to zero. Input costs 2,000 × $2.00 ÷ 1,000,000 = $0.004 per request. Output costs 500 × $10.00 ÷ 1,000,000 = $0.005. The total is $0.009 per request, $9.00 per day, or $270.00 for 30 days.

2. Compare cache reads and writes as separate input buckets

For a cache-read scenario, keep total input at 2,000, enter 1,000 cache-read tokens and zero cache-write tokens. That leaves 1,000 uncached tokens. The request costs $0.002 uncached input + $0.0002 cache read + $0.005 output = $0.0072.

For a cache-write scenario, enter zero cache-read tokens and 1,000 cache-write tokens. With the same total input and output, the request costs $0.002 uncached input + $0.0025 cache write + $0.005 output = $0.0095. This row assumes that every request writes 1,000 tokens. A prefix written once and reused later has a different average read/write mix.

3. Read the saving as a share of the whole token bill

The read scenario saves $1.80 per day or $54.00 over 30 days: ($270 − $216) ÷ $270 = 20%. Output still costs $5.00 per day in every row. A large discount on cached input therefore does not mean the same percentage saving on the entire request.

Use representative usage totals to estimate an average request, including writes, reads, and uncached misses. Check the provider’s supported models, minimum cacheable prefix, prefix matching, cache lifetime, and tier rules. This calculator models the token mix you enter; it does not enable caching or verify that a request received a cache hit.

Same workload and illustrative USD rates; only the input mix changes
Input tokens per requestPer requestPer day30 days
2,000 uncached$0.0090$9.00$270.00
1,000 uncached + 1,000 cache read$0.0072$7.20$216.00
1,000 uncached + 1,000 cache write$0.0095$9.50$285.00

Before applying the estimate

Calculate your own workload

Provider references for cache behavior and pricing

Assumptions and limits

  • All requests use the same average token counts and selected prices. Cache reads and cache writes are mutually exclusive portions of total input. The full write price replaces the normal input price for write tokens; it is not added again as a surcharge.
  • This is a token-based estimate, without a live price feed or tokenizer. Prices can differ by model, region, context length, processing tier, and provider. Apply Batch or other discounts by entering their actual applicable prices; no universal discount is assumed.
  • Tools, search, cache storage, image/audio/video charges, taxes, credits, minimum charges, and negotiated terms are excluded. Use one currency throughout. A period is exactly the entered number of days, and the provider usage statement is the authority for billed amounts.

Sources

  • OpenAI: API pricingSeparate input, cached-input, output, processing-mode, and tool pricing; rates must match the workload being estimated. Reviewed 2026-10-26.
  • Anthropic: Plans and pricingSeparate cache-read and cache-write prices and model-specific context tiers; cache writes are distinct from cache reads. Reviewed 2026-10-26.

Related calculators

Verification

How this calculator is checked

Trust comes from reproducible evidence, not model confidence. You can inspect the formula, assumptions, worked example, and cited sources on this page.

Frequently asked questions

Does this calculator use current OpenAI, Claude, or other model prices?

You enter the applicable current prices yourself. The calculator does not supply model presets or fetch a live price list. This lets you use any provider while choosing the correct model, region, context tier, and processing mode.

How do I avoid counting cached tokens twice?

Enter all input tokens in total input, then identify the cache-read and cache-write portions. The calculator subtracts both from the uncached input bucket. Enter the full price for each bucket. Cache reads plus cache writes cannot exceed total input.

Why can my actual AI API bill differ from this estimate?

Requests vary in token counts, cache hits, reasoning tokens, and context tiers. Providers can also bill tools, cache storage, media, or other services separately. Use actual token usage and matching prices to refine the estimate; the result is not an invoice.

Last updated 2026-11-08 · disjoint-input-cache-read-write-output-cost-v1 · content-2026-11-08 · Published by YunFanLabs