Agent Telemetry Summary
What the coding agent produced in a window, and what it cost (standalone).
Range-bounded like /v1/usage/summary (default last 30 days, hard-capped), so the aggregates stay served by the timestamp index. Returns the outcome totals (commits, pull requests, lines changed, active time), the behavioral counts already captured from the logs signal (tool calls and their mix, tool accept/reject, turns, API errors), the recorded spend over the same scope, and the derived per-unit measures: cost per commit / pull request / line, spend per active hour, acceptance rate, turns per session, and error rate. Each measure is null rather than an error when its denominator is zero. Filterable by user, API key, and session_label, so cost per outcome can be read for one agent session as well as for a whole window.
The spend side is every usage row in scope, not only the agent's: unfiltered, that includes traffic from clients that never reported telemetry, so a per-outcome measure read over a whole deployment answers "what did this deployment spend per commit", not "what did the agent spend per commit". Filter by user, API key, or session to divide only the matching spend.
Outcome metrics are stored exactly as the agent reported them, so a cumulative counter is converted to a window increment here, at read time, diffed per series generation: a re-exported total adds nothing, and a counter reset never reads as negative work. Master-key only.
Query parameters
Return rows with timestamp >= start_date (ISO 8601 or Unix epoch seconds)
Return rows with timestamp >= start_date (ISO 8601 or Unix epoch seconds)
Return rows with timestamp < end_date (ISO 8601 or Unix epoch seconds)
Return rows with timestamp < end_date (ISO 8601 or Unix epoch seconds)
Filter to one or more users; repeatable (user_id=a&user_id=b). Several values match any of them. At most 50 per call.
Filter to one or more users; repeatable (user_id=a&user_id=b). Several values match any of them. At most 50 per call.
Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.
Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.
Filter to a single agent session. Matches agent_telemetry.session_label and, on the usage side of the join, the usage_logs.source_label that /v1/usage/summary filters on
Filter to a single agent session. Matches agent_telemetry.session_label and, on the usage side of the join, the usage_logs.source_label that /v1/usage/summary filters on
Time-series granularity: 'hour' or 'day'
Time-series granularity: 'hour' or 'day'
Response
Successful Response