[view as .md]

Analytics & Logs API

Query aggregated metrics and individual request logs.

Analytics report

GET /manage/v1/analytics/report

Query parameters

NameTypeDescription
startISO 8601Window start
endISO 8601Window end
granularityenumhour, day
project_idstringScope to one project
group_byenummodel, provider, project, tag:<key>, end_user
tagsJSONAdditional tag filters (e.g. {"tenant":"acme"})
include_comparisonboolInclude previous-period series

Response (abbreviated)

{
  "series": [
    {
      "bucket": "2026-04-14T00:00:00Z",
      "requests": 1247,
      "cost_usd": 3.142,
      "input_tokens": 98213,
      "output_tokens": 45021,
      "errors": 3,
      "p50_latency_ms": 238,
      "p95_latency_ms": 801,
      "p99_latency_ms": 1420
    }
  ],
  "totals": {
    "requests": 1247,
    "cost_usd": 3.142,
    "error_rate": 0.0024
  }
}

Decisions summary

GET /manage/v1/analytics/decisions

Aggregate routing decisions: per config, which attempts ran, how often fallbacks fired, why.

Request logs

GET /manage/v1/logs

Query parameters

NameTypeDescription
startISO 8601Window start
endISO 8601Window end
project_idstringFilter
statusstringFilter by status class: 2xx, 4xx, 5xx
modelstringFilter by model name
providerstringFilter by provider
end_userstringFilter by end-user tag
tagsJSONTag key-value filters
min_latency_msintegerSlow-query filter
cursorstringPagination

Returns a paginated list of request summaries. Use the single-request endpoint below for full details.

Single request

GET /manage/v1/logs/{request_id}

Returns the full request: input messages (if retention allows), output, decision trace, per-attempt metrics, cost breakdown.

Request trace

GET /manage/v1/logs/{request_id}/trace

Just the decision trace: attempts, timings, reasons, final decision.

Replay

POST /manage/v1/logs/{request_id}/replay

Re-run a request against a specified routing config. Useful for debugging individual requests after a config change.

Request body

{
  "routing_config": "@candidate-v2",
  "dry_run": false
}

MCP tools

ToolMaps to
get_analytics_reportGET /manage/v1/analytics/report
get_decisions_summaryGET /manage/v1/analytics/decisions
list_logsGET /manage/v1/logs
get_logGET /manage/v1/logs/{id}
get_request_traceGET /manage/v1/logs/{id}/trace
replay_log_entryPOST /manage/v1/logs/{id}/replay

See also