Step-by-step answer
Core 60–90 min7 stepsBuild a per-matter cost model from usage logs
A uv project that generates a synthetic usage log of 200 matters, prices every call from a dated price table (5-minute and 1-hour writes, thinking, Haiku's long-context tier), and reports p50 and p95 cost per matter, cost by token class and agent, retry waste and cost per completed matter. The surprise is that once the loops are cached, the single uncached Opus report is the biggest line.
Back to the exercise