For the complete documentation index, see llms.txt. This page is also available as Markdown.

Agent telemetry

Delete Agent Telemetry Rows

delete

Delete agent_telemetry rows by explicit ids or by filter.

Target either an explicit selection (ids) or everything matching a filter (by_filter: true plus optional user_id / api_key_id / name / date range). A selection matching zero rows succeeds with deleted: 0. Master-key only.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

Selection of agent_telemetry rows to delete.

api_key_idany of · nullableOptional
stringOptional
or
string[] · max: 50Optional
by_filterbooleanOptionalDefault: false
end_datestring · date-time · nullableOptional
idsstring[] · max: 1000 · nullableOptional
namestring · nullableOptional
start_datestring · date-time · nullableOptional
user_idany of · nullableOptional
stringOptional
or
string[] · max: 50Optional
Responses
200

Successful Response

application/json

How many rows the delete removed.

deletedintegerOptionalDefault: 0
delete/api/v1/agent-telemetry
DELETE /api/v1/agent-telemetry HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 163

{
  "api_key_id": "text",
  "by_filter": false,
  "end_date": "2026-01-01T00:00:00.000Z",
  "ids": [
    "text"
  ],
  "name": "text",
  "start_date": "2026-01-01T00:00:00.000Z",
  "user_id": "text"
}
{
  "deleted": 0
}

Count Agent Telemetry

get

Total agent_telemetry rows matching the given filters.

The filter set mirrors the purge endpoint's, so this sizes exactly what a "delete all N matching" would remove. Behavioral and metric rows are counted together: neither this nor the purge distinguishes them. Master-key only.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
start_datestring · date-time · nullableOptional

Return rows with timestamp >= start_date (ISO 8601 or Unix epoch seconds)

end_datestring · date-time · nullableOptional

Return rows with timestamp < end_date (ISO 8601 or Unix epoch seconds)

user_idstring[] · max: 50 · nullableOptional

Filter to one or more users; repeatable (user_id=a&user_id=b). Several values match any of them. At most 50 per call.

api_key_idstring[] · max: 50 · nullableOptional

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.

namestring · nullableOptional

Filter to a single event type or metric name (e.g. 'tool_result', 'claude_code.commit.count')

Responses
200

Successful Response

application/json

Total number of agent_telemetry rows matching a set of filters.

totalintegerRequired
get/api/v1/agent-telemetry/count
GET /api/v1/agent-telemetry/count HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "total": 1
}

Agent Telemetry Series

get

Row volume over time, split by user or API key.

Mirrors /api/v1/usage/series: same window bounds and bucket-grid cap, the top groups as their own series with the remainder folded into a reconciling other, and sparse points (populated cells only). Counts rows, not spend, so it charts telemetry volume rather than cost. Master-key only.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
group_bystring · enumRequired

Dimension to split the series by

Possible values:
start_datestring · date-time · nullableOptional

Return rows with timestamp >= start_date (ISO 8601 or Unix epoch seconds)

end_datestring · date-time · nullableOptional

Return rows with timestamp < end_date (ISO 8601 or Unix epoch seconds)

user_idstring[] · max: 50 · nullableOptional

Filter to one or more users; repeatable (user_id=a&user_id=b). Several values match any of them. At most 50 per call.

api_key_idstring[] · max: 50 · nullableOptional

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.

namestring · nullableOptional

Filter to a single event type or metric name (e.g. 'tool_result', 'claude_code.commit.count')

bucketstring · enumOptional

Time-series granularity: 'hour' or 'day'

Default: dayPossible values:
Responses
200

Successful Response

application/json

A per-group row-volume series, for stacked charting.

bucketstring · enumRequiredPossible values:
end_datestringRequired
group_bystring · enumRequiredPossible values:
start_datestringRequired
get/api/v1/agent-telemetry/series
GET /api/v1/agent-telemetry/series?group_by=user_id HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "bucket": "hour",
  "end_date": "text",
  "group_by": "user_id",
  "groups": [
    {
      "is_other": false,
      "key": "text",
      "rows": 1
    }
  ],
  "points": [
    {
      "bucket_start": "text",
      "is_other": false,
      "key": "text",
      "rows": 1
    }
  ],
  "start_date": "text"
}

Agent Telemetry Summary

get

What the coding agent produced in a window, and what it cost.

Range-bounded like /api/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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
start_datestring · date-time · nullableOptional

Return rows with timestamp >= start_date (ISO 8601 or Unix epoch seconds)

end_datestring · date-time · nullableOptional

Return rows with timestamp < end_date (ISO 8601 or Unix epoch seconds)

user_idstring[] · max: 50 · nullableOptional

Filter to one or more users; repeatable (user_id=a&user_id=b). Several values match any of them. At most 50 per call.

api_key_idstring[] · max: 50 · nullableOptional

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.

session_labelstring · nullableOptional

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 /api/v1/usage/summary filters on

bucketstring · enumOptional

Time-series granularity: 'hour' or 'day'

Default: dayPossible values:
Responses
200

Successful Response

application/json

Agent outcomes and behavior for the window, joined against recorded spend.

bucketstring · enumRequiredPossible values:
end_datestringRequired
start_datestringRequired
get/api/v1/agent-telemetry/summary
GET /api/v1/agent-telemetry/summary HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "behavior": {
    "api_errors": 0,
    "by_tool": [
      {
        "calls": 1,
        "tool": "text"
      }
    ],
    "sessions": 0,
    "tool_accepts": 0,
    "tool_calls": 0,
    "tool_rejects": 0,
    "turns": 0
  },
  "bucket": "hour",
  "end_date": "text",
  "measures": {
    "cost_per_commit": 1,
    "cost_per_line": 1,
    "cost_per_pull_request": 1,
    "edit_acceptance_rate": 1,
    "error_rate": 1,
    "spend_per_active_hour": 1,
    "tool_acceptance_rate": 1,
    "turns_per_session": 1
  },
  "outcomes": {
    "active_time": 0,
    "commits": 0,
    "lines_of_code": 0,
    "pull_requests": 0
  },
  "series": [
    {
      "active_time": 0,
      "api_errors": 0,
      "bucket_start": "text",
      "commits": 0,
      "cost": 0,
      "lines_of_code": 0,
      "pull_requests": 0,
      "tool_calls": 0,
      "turns": 0
    }
  ],
  "start_date": "text",
  "usage": {
    "cost": 0,
    "requests": 0
  }
}

Last updated

Was this helpful?