latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-11333695.0 KB

9762a43a4598

Sessions

Get session usage stats

Returns cumulative usage stats (tokens, turns, tool calls) for a session, accumulated across all its agent runs. Only the session owner (same user + org) can access it. Omits the full message history — use GET /api/sessions/{sessionId} for the full transcript.

get/api/sessions/{sessionId}/stats

Path parameters

sessionIdstring required

Session ID (base64 URL-safe 32-byte token)

Headers

X-Grafana-Org-Idstring

Grafana organization ID for multi-tenant isolation. Defaults to '1' if not provided.

Response

Session usage stats

sessionIdstring required

Session ID (base64 URL-safe 32-byte token)

runCountinteger required

Number of completed agent runs (turns) in this session

totalIterationsinteger required

Sum of agent-loop iterations (LLM round-trips) across all runs

toolCallCountinteger required

Sum of tool calls executed across all runs

promptTokensinteger required

Sum of LLM prompt tokens across all runs

completionTokensinteger required

Sum of LLM completion tokens across all runs

totalTokensinteger required

Sum of LLM prompt + completion tokens across all runs

createdAtstring date-time required
updatedAtstring date-time required