| Name | Type | Description |
|---|---|---|
model_name* | str | The model that served this request. Combined with |
input_toks* | int | Input tokens for this request. |
output_toks* | int | Output tokens for this request. |
provider | str | Default: '' |
cost_usd | float | None | Default: None |
kind | UsageKind | Default: 'assistant' |
cache_read_tokens | int | Default: 0 |
cache_write_tokens | int | Default: 0 |
Accumulate usage for one completed LLM request.
Updates session totals plus the per-model and per-type breakdowns.
Provider that served the model (e.g. openai).
Combined with model_name to form the per-model key, so
the same model served by different providers is
tracked separately.
Estimated request cost, or None when no estimate exists.
Missing estimates leave monetary totals unchanged.
Request class used for /cost type breakdowns.
Input tokens served from provider caches.
Input tokens written to provider caches.