Goal
A cross-provider cost scalar so an agent subtree's economic footprint is comparable regardless of which provider each agent uses, plus a summary tool that reports it.
Why
Today, Usage carries input_tokens, output_tokens, cache_read_tokens, cache_creation_tokens per provider. The numbers are not directly comparable: an Opus 4.7 input token is not the same cost as a DeepSeek-Flash input token. A subtree of mixed-provider agents has no single cost figure.
Proposed design
- Define EIT (Effective Input Tokens) as the unit. Conversion factor per (provider, model, token-type) — fresh-input, output, cache-read, cache-creation each get their own factor based on published pricing.
- Store factors in
atn/model_specs.py (or a sibling file). Same longest-prefix lookup pattern.
- Add
AgentDefinition.budget_eit (optional). When set, runtime totals subtree EIT and refuses turns that would exceed it.
- New tool
get_cost_summary accessible from any agent: returns subtree EIT total, per-provider breakdown, cache-hit rate.
Acceptance
- A two-agent test (one on Claude Max, one on DeepSeek) reports a single subtree EIT figure that matches manual calculation.
- An agent with
budget_eit set refuses to start a turn that would push it over budget, and the snapshot shows the budget state clearly.
Goal
A cross-provider cost scalar so an agent subtree's economic footprint is comparable regardless of which provider each agent uses, plus a summary tool that reports it.
Why
Today,
Usagecarriesinput_tokens,output_tokens,cache_read_tokens,cache_creation_tokensper provider. The numbers are not directly comparable: an Opus 4.7 input token is not the same cost as a DeepSeek-Flash input token. A subtree of mixed-provider agents has no single cost figure.Proposed design
atn/model_specs.py(or a sibling file). Same longest-prefix lookup pattern.AgentDefinition.budget_eit(optional). When set, runtime totals subtree EIT and refuses turns that would exceed it.get_cost_summaryaccessible from any agent: returns subtree EIT total, per-provider breakdown, cache-hit rate.Acceptance
budget_eitset refuses to start a turn that would push it over budget, and the snapshot shows the budget state clearly.