All metric classes except
ToolCallMetrics inherit from BaseMetrics, which provides the shared token and cost fields.
BaseMetrics
Shared token fields inherited byRunMetrics, MessageMetrics, SessionMetrics, and ModelMetrics.
RunMetrics
Used onRunOutput.metrics and TeamRunOutput.metrics. Includes all BaseMetrics fields plus:
details keys
The details dictionary uses model type strings as keys. Each key maps to a list of ModelMetrics objects (one per unique model (provider, id) pair).
Eval agent metrics are prefixed with
eval_. If an eval agent uses model types "model" and "output_model", the details keys become "eval_model" and "eval_output_model".
Metrics is preserved as a backward-compatible alias for RunMetrics. Both from agno.metrics import Metrics and from agno.models.metrics import Metrics still work.MessageMetrics
Used onMessage.metrics. Per-API-call metrics. Includes all BaseMetrics fields plus:
SessionMetrics
Returned byagent.get_session_metrics(). Aggregated across all runs in a session. Includes all BaseMetrics fields plus:
ModelMetrics
Per-model aggregate stored insideRunMetrics.details[model_type]. Includes all BaseMetrics fields plus:
ToolCallMetrics
Used onToolExecution.metrics. Standalone class (does not inherit BaseMetrics).
Provider field availability
Not all providers populate all fields. This table shows whichBaseMetrics fields each provider sets on MessageMetrics.
“Standard tokens” =
input_tokens, output_tokens, total_tokens. “Audio tokens” = audio_input_tokens, audio_output_tokens.