ai.events.Usage
class in the ai package.
Reference version
Signature
class ai.events.UsageSource:<builtin>/ai/ns_events/events.bamlbytes 2698–3202
Fields
input_tokens
intoutput_tokens
intcached_input_tokens
int | nullreasoning_tokens
int | nullcache_write_input_tokens
int | nullTokens written to the provider's prompt cache, billed above the input rate. Null when the provider reports none.
uncached_input_tokens
int | nullInput tokens billed at the full rate: input_tokens without cache
reads and writes, whichever way the provider counts them. Null when
the provider cannot tell.