A token log can support a dollar estimate. It cannot tell you what a subscription cost.
The distinction sounds obvious until a report card shows a large number. Without a visible definition, readers interpret it as spend or savings. The implementation needs an accounting rule before it needs a chart.
Calculate by token category
For each local usage event, keep input, output, cache creation, and cache reads separate. Apply the matching per-million rate to each category and add the results.
value = input * input_rate
+ output * output_rate
+ cache_create * cache_create_rate
+ cache_read * cache_read_rate
Each token quantity is divided by one million in the actual calculation. The rate table must carry a snapshot date.
Codex needs an extra parsing step because its input count includes cached input. Subtract the cached portion first, then price normal input and cache reads separately. Otherwise the cached tokens are charged twice in the estimate.
Do not guess unknown models
A newly released model can appear before the embedded table knows its rate. Assigning a nearby model's price makes the total look complete but weakens its meaning.
The macOS v1.6.1 implementation I work on prices a named model missing from the rate table at zero and records an unpriced warning. A Codex row received before model context instead uses the parser's gpt-5.4 model fallback. The displayed total can be low, but the gap is visible and correctable.
Define the claim
API value means the value of recorded token activity under a dated API-price snapshot.
It does not mean:
- subscription spend;
- money saved;
- revenue;
- an exact provider invoice.
Actual spend requires billing records, credits, taxes, discounts, and contract terms. Local session logs do not contain that information.
Keep volume separate
Wire-token volume includes cache activity. API value applies different prices to each category. A cache-heavy week can have a large token count and a much smaller value estimate than its headline suggests.
Showing both measures is useful. Naming them precisely prevents one from borrowing the meaning of the other.
I build Agent Island, and this article describes the released macOS calculation. The broader rule applies to any local usage tool: date the prices, preserve cache semantics, expose unknown models, and never label a counterfactual as a bill.
The full definition and implementation boundaries are documented on the Agent Island Blog.
Top comments (0)