Response fields request_id stringRequest identifier, useful for troubleshootingdata objectUsage query resultdata.query_range objectActual query range. Returned only for workspace and agent dimensions; not returned for sessiondata.query_range.start_time stringAligned start time, inclusive, always in the +08:00 time zonedata.query_range.end_time stringAligned end time, exclusive, always in the +08:00 time zonedata.data_updated_at string / nullLatest known update time among the usage records in this response, always in the +08:00 time zone; null if there are no records or the update time is unknowndata.usage objectTotals and grouped detailsdata.usage.total objectSummary metrics for the query range; see Summary metrics (total)data.usage.models arrayUsage details grouped by model name; [] if there are no detailsdata.usage.tools arrayUsage details grouped by tool source and name; [] if there are no detailsSession queries return the same usage structure without query_range or session metadata such as title and status. The service verifies session ownership before querying lifetime cumulative usage. If the session exists but has no statistics yet, each metric value is null and the model and tool detail arrays are empty; the session is not reported as nonexistent. | Response example A successful request returns HTTP 200 with top-level fields request_id and data. The following is the summary for the agent request above: the second-level start and end times are aligned by hour to 10:00—15:00 UTC+8. Values are for illustration only.{
"request_id": "req_summary_example",
"data": {
"query_range": {
"start_time": "2026-11-02T10:00:00+08:00",
"end_time": "2026-11-02T15:00:00+08:00"
},
"data_updated_at": "2026-11-02T14:10:00+08:00",
"usage": {
"total": {
"input_tokens": {"value": 1000, "unit": "tokens"},
"output_tokens": {"value": 200, "unit": "tokens"},
"total_tokens": {"value": 1200, "unit": "tokens"},
"cache_read_tokens": {"value": 400, "unit": "tokens"},
"cache_creation_tokens": {"value": 100, "unit": "tokens"},
"cache_hit_ratio": {"value": 0.4, "unit": "ratio"},
"model_call_count": {"value": 5, "unit": "count"},
"tool_call_count": {"value": 3, "unit": "count"},
"builtin_tool_call_count": {"value": 0, "unit": "count"},
"mcp_tool_call_count": {"value": 3, "unit": "count"},
"custom_tool_call_count": {"value": 0, "unit": "count"},
"turns": {"value": 2, "unit": "count"},
"steps": {"value": 8, "unit": "count"},
"interrupt_error_count": {"value": 0, "unit": "count"},
"model_failed_count": {"value": 1, "unit": "count"},
"tool_failed_count": {"value": 1, "unit": "count"},
"runtime_ms": {"value": 60000, "unit": "ms"}
},
"models": [
{
"model_name": "qwen-plus",
"usage": {
"input_tokens": {"value": 1000, "unit": "tokens"},
"output_tokens": {"value": 200, "unit": "tokens"},
"total_tokens": {"value": 1200, "unit": "tokens"},
"cache_read_tokens": {"value": 400, "unit": "tokens"},
"cache_creation_tokens": {"value": 100, "unit": "tokens"},
"cache_hit_ratio": {"value": 0.4, "unit": "ratio"},
"call_count": {"value": 5, "unit": "count"},
"failed_count": {"value": 1, "unit": "count"}
}
}
],
"tools": [
{
"source": "mcp",
"tool_name": "web_search",
"usage": {
"call_count": {"value": 3, "unit": "count"},
"failed_count": {"value": 1, "unit": "count"}
}
}
]
}
}
}
|