usage_attribution
Report token usage with its accounted share, denominators, and metric labels to reveal incomplete sub-agent coverage and avoid misleading totals.
Instructions
Report token usage together with how much of it can actually be accounted for.
Read-only. Every token number comes back alongside its denominator (dispatches_total) and its metric label, because a token count without those two is meaningless: this repo carries two orthogonal metrics that measure 5-25x apart, and sub-agent usage coverage is incomplete (the response reports the measured share). There is deliberately no total field: cache_read dominates the four layers, so a lone total is mostly a cache-read count in disguise.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Look-back window in days, counted on row creation time. 0 means all history. Never windowed on measurement time — that would drop unmeasured rows out of the denominator and pin coverage at 100%. | |
| scope | No | Attribution level — project / session / workflow_run / agent / task. Leave empty to get the coverage matrix (all dispatch paths plus per-hop link coverage) instead of one scope's usage. | |
| scope_id | No | ID at that level. Empty means "do not filter on this dimension", i.e. aggregate across the whole ledger. | |
| population | No | Dispatch path — "subagent" or "leader_session". These are never merged: one leader session can outweigh every sub-agent combined, which would drown the sub-agent numbers. | subagent |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||