How to Measure Real Quota Usage for Subscription-Based AI Coding Plans

    Subscription AI coding plans rarely consume quota in proportion to raw token counts. This article explains the four-way token weighting behind hidden billing, a reproducible jump-based experiment to recover per-token quota rates, and how to convert those rates into effective capacity under a real workload mix.

    1. The gap between advertised capacity and real usage

    As AI coding tools moved to subscription pricing, a recurring argument is that a plan’s advertised token capacity looks comparable to, or even larger than, leading overseas offerings, yet day-to-day use still brushes against quota limits. To judge that comparison, start from a premise: subscription quota is usually not issued as a linear token budget. Behind it sits an unpublished weighted metering model.

    The useful unit is therefore “quota consumed per million tokens,” not “tokens included in the plan,” which is often a marketing figure. This article is not about a specific product. It addresses a general problem: without official billing docs, how to recover real quota burn with a reproducible experiment, then estimate usable capacity under real workloads.

    2. Hidden billing: four token types with very different weights

    Mainstream inference services typically split a request into four token classes whose unit costs differ sharply:

    • Fresh (cache-miss) input: fully participates in attention; highest input cost.
    • Cache write: writing a prefix into the KV cache; slightly more expensive than cache read.
    • Cache read (hit): reuses existing KV; cheapest, often one to two orders of magnitude below fresh input.
    • Output: autoregressive generation; usually the most expensive class.

    Subscription quota is typically a normalized mapping of this cost structure: different tokens are converted into a single quota unit by weight. The same 1 million tokens can therefore consume tens of times more or less quota depending on mix.

    3. Reverse-engineering: “dose” experiments on integer quota jumps

    Most consoles show only integer percentages, so a single reading is too coarse. Use a single-variable experiment.

    3.1 Design: burn one token class at a time

    Drive other classes toward zero:

    1. Cache read: write a fixed-length context, wait for the cache, then reuse the same prefix.
    2. Fresh input: change content every request so the cache never hits.
    3. Cache write: keep introducing new prefixes and observe mixed write/read burn.
    4. Output: keep input extremely short and stretch output length.

    3.2 Averaging out integer-percentage quantization

    Do not rely on one jump. Run continuously and record tokens used across full 1% intervals (17%→18%, 18%→19%, …), then average:

    1. # Recover quota burn per token from integer percentage jumps
    2. def measure_rate(send_request, quota_fn, token_counter, target_jumps=8):
    3. """Return tokens corresponding to 1% of quota."""
    4. samples, used, prev = [], 0, quota_fn()
    5. while len(samples) < target_jumps:
    6. send_request()
    7. used += token_counter() # this request's tokens of the target class
    8. cur = quota_fn()
    9. if cur < prev: # integer percentage dropped by 1
    10. samples.append(used / (prev - cur))
    11. used, prev = 0, cur
    12. return sum(samples) / len(samples)

    Averaging full intervals flattens error from jumps landing mid-interval. Enough requests per interval average out hit-rate noise and network jitter.

    4. From burn rates to equivalent capacity: weight by real mix

    Do not add the four rates. Weight them by the actual workload. Inflated “capacity” numbers often assume an extremely cache-friendly mix:

    Token type Assumed share
    Cache-hit input 97%
    Fresh input 2.5%
    Output 0.5%

    Under that mix, only 5,000 of each million tokens are output; almost everything takes the cheapest cache-read path:

    1. # Weighted equivalent capacity (RATE = tokens per 1% quota; illustrative)
    2. MIX = {"cache_read": 0.97, "fresh_input": 0.025, "output": 0.005}
    3. RATE = {"cache_read": 1.0e7, "fresh_input": 2.0e5, "output": 5.0e4}
    4. cost_per_mtok = sum(MIX[k] * 1e6 / RATE[k] for k in MIX) # % quota per million tokens
    5. capacity_mtok = 100.0 / cost_per_mtok # million tokens at full quota

    Replace MIX with your sampled distribution and capacity_mtok often falls by several times. That is the main source of advertised vs. felt capacity.

    5. Where optimism comes from: fragile cache assumptions

    A 97% cache hit rate is like an EV’s rated range: it assumes continuous, light, low-speed, no-wind driving. Real development usually breaks that:

    • Frequent task switches: a new file or requirement changes the prefix and invalidates the cache.
    • Cache TTL: idle time forces a rewrite.
    • Compression and rewriting: long sessions trigger summarization or truncation and change prefix structure.
    • Higher output share: refactors, tests, and long docs push output well above 0.5%.
    • Concurrency: multiple windows dilute reuse.

    Everyday discount is large: a “500 km” car may deliver under 350 km in stop-and-go use; a quota billed as tens of millions of tokens may yield only one-third to one-half under a mixed load.

    6. A reproducible evaluation workflow

    1. Sample first, then compute: log a week of real requests (log service or local proxy) and measure the four-class mix; do not reuse a vendor-style default mix.
    2. Build your own burn-rate baseline: run the single-variable tests above and remeasure periodically; server-side policy can change.
    3. Watch refresh mechanics: period, rollover, concurrency caps, and rate limits matter as much as unit price.
    4. Cross-check at task granularity: average quota to finish a medium-complexity task as a second ruler next to token math.
    5. Make measurement observable: on platforms such as Baidu AI Cloud, use monitoring, alerts, and logs to trend call volume vs. quota so you are not surprised at month-end.

    7. Conclusion

    Comparing “equivalent tokens” across plans is comparing two hidden weighting schemes projected onto a load assumption. Capacity numbers detached from mix have little decision value. A reliable approach is: measure real burn rates for the four token classes, weight them with your sampled mix, run sensitivity on cache hit rate, and validate with task-level cost. Only then can claims such as “this plan matches that offering” be confirmed or rejected—and in most real development settings, discounted usable capacity is clearly below the theoretical figure.