Quanta

← Back to Briefings

Four Token Buckets in a High-Volume Team’s Bill

Cost at volumeEN7 reads

01 · A per-call bill has four token buckets

For a team running sustained coding agents, document processing or automated reviews, a small misunderstanding on one API call becomes a recurring budget problem. The useful question is not simply how many tokens a request used. It is which tokens were billed as ordinary input, generated output, cache creation or cache retrieval.

Quanta is a pay-as-you-go API relay that meters calls on real tokens, with cache writes and cache reads priced separately. That makes the individual call a useful starting point for understanding workload economics. Read its billing categories before extrapolating a daily or monthly budget.

02 · Input pays for context the model processes

Input tokens represent material supplied to the model: instructions, conversation history, retrieved documents, code and tool results. A short user question can therefore produce a large input count when an agent also sends repository context or a lengthy conversation.

Check whether the reported input total includes cached tokens. Usage fields are not necessarily organized identically across models and interfaces. A total input field may include tokens that receive separate cache treatment. Do not multiply that entire total by the ordinary input rate and then add cache charges without confirming the accounting; that can double-count part of the request.

03 · Output pays for generation, not just answer length

Output tokens cover generated material. For an engineering workflow, that can include explanations, code and tool-call arguments, rather than only the final text a person reads. Where a model reports additional billable generation categories, include them according to its billing definition rather than estimating from the visible answer.

A concise response format and an appropriate output limit can help control generation costs. However, a limit that repeatedly cuts off useful work may cause retries and increase the total cost of completing the task. Measure successful completion, not just cheap individual responses.

04 · Cache writes create reusable context; reads reuse it

A cache write records eligible input for later reuse. A cache read uses context that is already available in the cache. These are separate billing categories, not free versions of ordinary input.

Think of a coding agent that repeatedly sends stable project instructions alongside changing files. The stable portion may be eligible for reuse, while the changing portion still needs ordinary processing. A write can create an upfront charge; subsequent reads can improve the economics if their applicable rate is lower and enough requests reuse that context.

Repetition alone does not guarantee a cache hit. Eligibility, matching rules, minimum lengths and retention behavior can vary. Verify the relevant model’s behavior and inspect actual usage. Changing a shared prefix or waiting beyond the applicable retention window may turn an expected read into another write or ordinary input.

05 · Reconcile one call before forecasting a million

Normalize the bill into mutually exclusive categories, then calculate:

Call cost = ordinary input tokens × input rate + output tokens × output rate + cache-write tokens × write rate + cache-read tokens × read rate.

Keep units consistent. If rates are quoted per million tokens, divide each token count by one million before applying its rate. Use the rates applicable to that specific model and call; do not assume Claude Sonnet 5.5 and Gemini 2.5 Flash share prices or cache rules.

  • › Record the model, request identifier, token categories and charged amount.
  • › Compare first calls with repeated calls to separate cache creation from reuse.
  • › Investigate retries, growing conversation history and unexpectedly long outputs.
  • › Track total cost per completed task alongside cost per call.

06 · Set workload budgets around observed reuse

For heavy workloads, Quanta is worth considering when one balance across multiple models simplifies spending management. Open an account and run a representative pilot before setting production budgets.

Base that pilot on real request sequences, including cold starts, repeated context and failures. Forecast from the observed mix of all four token buckets, then set spending alerts and review exceptions. A low-cost cached call is useful evidence, but a sustainable budget must also cover the calls that build, miss or refresh the cache.