Large API Credits: How Cache Hit Ratio Determines Real Token Usage
This article explains how to convert large API credits into usable token volume using example input, output, and cache-read prices. It compares a lightweight model with a mainstream code model, shows how the cache-hit ratio changes the effective input cost, and distinguishes KV cache from cross-request prompt caching. Readers get a repeatable way to estimate real usage before choosing a plan.
After AI coding tools introduce large API credits, developers can easily be drawn to the headline number. A credit measures monetary value; how many tokens it can cover depends on the model’s input price, output price, and cache-read price, as well as the user’s cache-hit ratio. Using example unit prices, this article shows how to perform the conversion so readers can run their own numbers before selecting a plan.
1. Convert Credits into Token Volume First
For ease of calculation, the table below uses example assumed prices in USD per million tokens. These numbers are only for demonstrating the calculation method and do not represent any platform’s official pricing. For actual selection, refer to the provider’s latest pricing page.
| Plan | Input price | Output price | Cache-read price |
|---|---|---|---|
| Lightweight model (example) | 0.30 | 1.20 | 0.006 |
| Mainstream code model (example) | 1.40 | 4.40 | 0.26 |
At these example prices, looking only at input, $500 of the mainstream code model can process about 357 million input tokens, while $100 of the lightweight model can process about 333 million input tokens—a relatively small difference. If all input hits cache, $500 of the mainstream model can read about 1,923 million cache tokens, while $100 of the lightweight model can read about 16,667 million cache tokens.
The output-token situation is similar. $500 of the mainstream model can generate about 114 million output tokens, while $100 of the lightweight model can generate about 83 million output tokens.
The conclusion therefore depends on the cache-read share of input. Let c be the cache share. The blended price per million input tokens is approximately 1.40 − 1.14c for the mainstream model and 0.30 − 0.294c for the lightweight model. When the mainstream model’s blended price exceeds the lightweight model’s blended price by 5x, $500 of credit provides less usable input than $100 of the lightweight plan. Solving for this condition shows that it holds when the cache share is about 30% or higher. This threshold considers only the input side. In actual selection, the output share should also be included in the calculation.
For example, assume monthly input is 1,000 million tokens and the cache share is 40%. The mainstream model’s monthly input cost is about 1,000 × (0.4 × 0.26 + 0.6 × 1.40) ≈ $944, and the lightweight model’s is about 1,000 × (0.4 × 0.006 + 0.6 × 0.30) ≈ $182. This example does not include output fees.
2. Distinguish Two Kinds of Cache: In-Request Reuse and Cross-Request Caching
Many articles conflate the two kinds of cache, which can lead to incorrect cost judgments.
The first is KV Cache. During autoregressive generation in a Transformer, the model stores key-value vectors that have already been computed and reuses them in later generation steps to avoid duplicate computation. This happens server-side within a single inference process and reduces latency and compute consumption. Users do not pay for it directly, but the provider’s inference cost decreases, which can indirectly affect pricing.
The second is cross-request prompt caching. A provider stores an identical prefix—such as a system prompt and project context—for a period of time. If another request arrives within the valid period, that prefix is billed at the cache-read price. After the period expires, the cache becomes invalid; the next request must be billed at the full input price and the prefix must be recomputed.
The specific validity period varies by provider. Before selecting a plan, check the official documentation to confirm whether the period is refreshed by another access and whether timing is calculated per request or by time.
A common scenario is a developer modifying code, running a long build or test, and returning to the chat window after ten minutes or more.
