Skip to main content
This endpoint provides comprehensive user metrics including activity patterns, token usage, and cost analytics. Use advanced filtering to segment users and pagination to handle large result sets.

Use Cases

  • Generate detailed user analytics reports
  • Identify most active users
  • Track user engagement over time
  • Calculate average requests per active day
  • Monitor per-user costs and token consumption

Request Body

UserFilterNode
required
Filter criteria for users. Can be “all” to retrieve all users, or a filter tree structure to specify conditions.
number
required
Number of records to skip for pagination (0-based)
number
required
Maximum number of records to return. Cannot exceed 1000.
object
Time range for filtering data
number
required
Start time as Unix timestamp in seconds
number
required
End time as Unix timestamp in seconds
number
Time zone difference in minutes from UTC for time-based calculations
SortLeafUsers
Sorting configuration for the results

Response

Returns a Result object containing user metrics data.
object
User metrics response object
UserMetricsResult[]
Array of user metrics objects
string
Internal user record ID
string
The user identifier
number
Number of days the user has been active
string
ISO 8601 timestamp of first activity
string
ISO 8601 timestamp of last activity
number
Total number of requests made by the user
number
Average number of requests per active day
number
Average total tokens (prompt + completion) per request
number
Total completion tokens generated
number
Total prompt tokens consumed
number
Total cost in USD
number
Total number of users matching the filter (for pagination)
boolean
Whether any users were found
string | null
Error message if the request failed, null otherwise

Example Request

Example Response

Error Response

Notes

  • Maximum limit is 1000 users per request
  • Use offset and limit for pagination through large result sets
  • Active days are calculated based on days with at least one request
  • Costs are calculated based on model pricing at the time of each request