Describe Session Token Usage
describe_session_token_usageBreak down an agent session's token usage per inference turn, returning per-turn entries and an aggregated summary while excluding non-inference events like tool calls.
Instructions
Break down a single agent session's token usage per inference turn.
Fetches the session's raw event messages and filters to inference turns (inference-succeeded, inference-failed), returning one entry per turn along with an aggregated summary. Non-inference events (tool calls, status transitions) are excluded from the breakdown.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>"
},
"name": "describe_session_token_usage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | The session ID to break down per inference turn |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| turns | No | Ordered list of per-turn usage details | |
| summary | Yes | Aggregated totals across all inference turns in the session |