Get User Activity
Retrieve tenant analytics for a time window.
GET/v1/customer/analytics
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
start_date | string (YYYY-MM-DD) | Start date in UTC. Defaults to 7 days before end_date. | |
end_date | string (YYYY-MM-DD) | End date in UTC. Defaults to today. | |
api_key_id | string | Filter analytics to a single API key owned by the tenant. |
Request Example
bash
curl "https://api.therouter.ai/v1/customer/analytics?start_date=2026-02-01T00:00:00.000Z&end_date=2026-02-07T00:00:00.000Z"
-H "Authorization: Bearer $THEROUTER_API_KEY"Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
summary.total_spend | integer (credits) | Total metered spend for the window. This includes shared model charges, BYOK platform fees, and any live skill/tool charges. | |
summary.shared_model_spend | integer (credits) | Spend from shared-capacity model usage only. | |
summary.byok_platform_fees | integer (credits) | Platform fees charged on BYOK requests. BYOK model usage itself is billed by the upstream provider, not by TheRouter.ai. | |
summary.managed_tool_fees | integer (credits) | Managed tool fees for platform capabilities such as TheRouter Web Search. | |
summary.agent_runtime_fees | integer (credits) | Agent/runtime fees. This field is present for forward compatibility and remains 0 until runtime monetization is launched. | |
summary.search_requests | integer | Count of successful managed web tool invocations in the window. | |
timeseries[].shared_model_spend | integer (credits) | Daily shared-capacity model spend. | |
timeseries[].byok_platform_fees | integer (credits) | Daily BYOK platform fees. | |
timeseries[].managed_tool_fees | integer (credits) | Daily managed tool fees. | |
timeseries[].agent_runtime_fees | integer (credits) | Daily agent/runtime fee total. Remains 0 until runtime monetization is live. |
Response
json
{
"period": {
"start_date": "2026-02-01T00:00:00.000Z",
"end_date": "2026-02-07T00:00:00.000Z"
},
"summary": {
"total_requests": 310,
"successful_requests": 305,
"failed_requests": 5,
"error_rate": 1.61,
"total_tokens": 204631,
"prompt_tokens": 98211,
"completion_tokens": 106420,
"shared_model_spend": 4021,
"byok_platform_fees": 315,
"managed_tool_fees": 114,
"agent_runtime_fees": 0,
"search_requests": 19,
"total_spend": 4450,
"avg_latency_ms": 421.3
},
"timeseries": [
{
"date": "2026-02-01",
"requests": 143,
"prompt_tokens": 48211,
"completion_tokens": 50211,
"tokens": 98422,
"shared_model_spend": 1800,
"byok_platform_fees": 120,
"managed_tool_fees": 42,
"agent_runtime_fees": 0,
"search_requests": 7,
"spend": 1962
}
]
}Grouped Export
bash
curl "https://api.therouter.ai/v1/customer/analytics/export.csv?start_date=2026-02-01&end_date=2026-02-07" \
-H "Authorization: Bearer $THEROUTER_API_KEY"Notes
This endpoint uses
start_date/end_date query params, not from/to.Billing semantics
Use analytics for grouped reporting. For request-level billing components, use
/v1/customer/logs or the monthly /v1/customer/billing/usage-statement.csv export.