pub struct UsageBreakdown {
pub system_prompt_tokens: u64,
pub skills_tokens: u64,
pub tool_calls_input_tokens: u64,
pub tool_calls_output_tokens: u64,
pub user_messages_tokens: u64,
pub model_output_tokens: u64,
}Expand description
The session’s token usage, split by what it bought. The five input
categories share each request’s reported input tokens in proportion
to their wire bytes (tool definitions ride with the calls that
use them); the model’s generated output tokens all land on
model_output_tokens, which also carries the assistant text the
history re-sends. The compaction block travels as a user message
and counts there.
Fields§
§system_prompt_tokens: u64The system prompt minus its skills section.
skills_tokens: u64The skills section of the system prompt, when the agent could isolate it at render time; zero otherwise.
tool_calls_input_tokens: u64Tool definitions plus the tool-call arguments re-sent in assistant messages.
tool_calls_output_tokens: u64Tool results — the tools’ output, re-sent as input.
user_messages_tokens: u64User text, the compaction block included.
model_output_tokens: u64The model’s words: assistant text in the history plus every generated output token.