GameLoop::UsageTotals
Accumulated token usage across all API calls in a single turn. The Tool
Runner may make several requests (one per tool hop), so we sum them with
#add. cache_read / cache_creation make prompt-caching effectiveness
visible. NOTE: Anthropic's input_tokens excludes cached tokens; the cache
fields are reported separately, so cache_hit_percent uses all three.
Constructors
Instance methods
add(usage : Anthropic::Usage) : Nil
Sourceadd(other : UsageTotals) : Nil
Merge another turn's totals into this one (used to accumulate usage across the whole autopilot run).
cache_creation
Sourcecache_read
Sourceinput
Sourceoutput
Sourcethinking
Source