get_user_stats
Retrieves per-user request and cost analytics for a specified time range; requires an Enterprise Portkey plan.
Instructions
Return per-user request and cost analytics for a required time range. This is usage-by-user, not population metrics; use get_users_analytics for active-user or cohort trends. Enterprise-gated. Returns 403 on non-Enterprise Portkey plans.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"time_of_generation_min": "<time_of_generation_min>",
"time_of_generation_max": "<time_of_generation_max>"
},
"name": "get_user_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cost_max | No | Maximum cost in cents to filter by | |
| cost_min | No | Minimum cost in cents to filter by | |
| page_size | No | Number of results per page (max 100) | |
| status_code | No | Filter by specific HTTP status codes (comma-separated) | |
| virtual_keys | No | Filter by specific virtual key slugs (comma-separated) | |
| total_units_max | No | Maximum number of total tokens to filter by | |
| total_units_min | No | Minimum number of total tokens to filter by | |
| time_of_generation_max | Yes | End time for the analytics period (ISO8601 format, e.g., '2024-02-01T00:00:00Z') | |
| time_of_generation_min | Yes | Start time for the analytics period (ISO8601 format, e.g., '2024-01-01T00:00:00Z') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Call succeeded | |
| data | No | Success payload | |
| error | No | Failure details |