Agent cost is turns times context rather than payload size
Most of a 9M-token run went to cache reads, with turns and coverage setting the bill.
SymptomA multi-agent run reports millions of tokens, while its tool results add up to a few hundred KB.
A nightly job I run researches buying committees with a fan-out of dozens of agents. Its usage report said about 9M tokens. The output it generated was a small fraction of that.
Most of the headline was cache reads, with each agent re-reading its own growing context every turn.
Anthropic's prompt caching documentation prices cache reads at a tenth of base input, lower for some models, so the dollar cost sits far below the headline. My token budget counts them all the same.
The heaviest agent ran 124 turns while its context grew from 62k to 235k tokens. Its tool payloads came to 160 KB in total.
So cost is turns times context per turn, per agent. In an 88-turn run, a 13k-token result landing at turn 30 gets re-read about 58 times.
The bigger dial sat outside the code. Whole-run tokens scaled about linearly with coverage, roughly 300k per person researched.
How many people to research is a product decision. I price it per person for the stakeholder instead of promising that a code trim will halve the bill.
Take the transcripts of the largest of your last 10 multi-agent runs by tokens. List each agent's turn count. List each agent's context size at the first and last turn. List each agent's output tokens against its cache-read tokens. Cache reads making up most of the total is expected. Look for context that grows to 3 times its first-turn size or more, since turns drive cost rather than payloads.
Passes ifNo agent's context at its last turn is 3 times its first-turn size or more. Turns times average context explains most of the total.
Access needed:agent-transcripts
- 01Split a run's usage into output, cache writes and cache reads before reacting to the total.
- 02Rank agents by turns times average context per turn, not by payload size or agent count.
- 03Batch independent tool calls into one turn. Cap how much context each agent accumulates.
- 04Price coverage per unit, such as per account or per person. Give that price to whoever decides scope.