Cached Input Cost Calculator
Mixed input cost equals cached tokens at the cache-read rate plus remaining tokens at the uncached rate. A cache hit fraction is an input assumption, not a guaranteed provider behavior.
Formula & method
Cost = total input × [(1 − cached share) × uncached rate + cached share × cache-read rate] ÷ 1,000,000.Worked example
| Input | Value |
|---|---|
| Total input tokens | 1,000,000 |
| Share billed as cache reads | 60 % |
| Uncached input rate per million | 3 ¤ |
| Cache-read rate per million | 0.5 ¤ |
| Result | Value |
|---|---|
| Mixed input charge | 1.5 ¤ |
| All-uncached comparison charge | 3 ¤ |
| Difference from comparison charge | 1.5 ¤ |
Compare scenarios
The first input changes while the other example inputs stay fixed. These are arithmetic scenarios, not forecasts.
| Compare scenarios | Total input tokens | Mixed input charge | All-uncached comparison charge | Difference from comparison charge |
|---|---|---|---|---|
| −20% | 800,000 | 1.2 ¤ | 2.4 ¤ | 1.2 ¤ |
| Example | 1,000,000 | 1.5 ¤ | 3 ¤ | 1.5 ¤ |
| +20% | 1,200,000 | 1.8 ¤ | 3.6 ¤ | 1.8 ¤ |
Assumptions & limits
This simplified comparison has two input billing categories. It excludes cache-write prices, storage, output and tool charges. If your provider bills writes separately, account for them in addition and do not classify written tokens as cache reads.
Displayed results are rounded. Calculations use unrounded JavaScript numbers; small floating-point differences are possible.
Works in your browser
The interactive tool runs in a sandbox with network access blocked. ClearByte and the advertising scripts cannot read values inside it. Browser extensions and a compromised device remain outside this protection.
Sources & definitions
Method checked:
Continue with a related task
AI Token Cost Calculator
Token cost equals input tokens × input rate ÷ one million plus output tokens × output rate ÷ one million. Enter the rates for your actual provider and processing tier.
AI Request Budget Calculator
Affordable whole requests equal budget divided by estimated per-request token cost, rounded down. The calculation assumes the same average input and output usage for each request.
Context Window Budget Calculator
Remaining context equals the supplied context limit minus instruction tokens, history tokens and output reserve. Count all relevant prompt material using your provider’s tokenization rules.
Token Generation Time Calculator
For positive output length, estimated time equals first-token latency plus the remaining token count divided by the generation rate. Zero requested tokens gives zero modeled generation time.