Expand description
Provider-keyed usage normalizers. Each turns a provider’s raw usage
object into token buckets. The agent dialects and the obol house dialect
share these so the per-provider accounting — the cache-bucket split, the
OpenAI cached-subtraction, the part naive summers get wrong — lives in one
place, not once per dialect.
Modules§
- anthropic
- Anthropic
usageobject ->ProviderTokens. Shared byclaude.rs(Claude Code embeds this object near-verbatim) and theobolhouse dialect. - openai
- OpenAI Responses-API
usageobject ->ProviderTokens.input_tokensis a total that still includes cached tokens, so the uncached bucket is the difference — the cached-subtraction a producer must never do itself.
Structs§
- Provider
Tokens - Token buckets extracted from a provider
usageobject. Model, provider, namespace and service_tier are the caller’s to attach;request_input_tokensis derived from these by the caller.