v1

latestOpenAPI 3.1.02026-07-26269227514.8 KB

Get active users analytics

Query the number of distinct active users for the authenticated team. A user is counted as active for a time bucket if they have any billing event in it. Results are sourced from hourly-aggregated billing events and can be filtered by date range, product, model, and group.

Use granularity to break the count down per day or month, and group_by=user to return one row per user (each row's active_users will be 1).

Responses are cached for 1 hour. Use If-None-Match with a previously returned ETag to receive a 304 Not Modified when the data has not changed.

These endpoints are designed for periodic reporting and bulk export. They are not intended for real-time usage monitoring: data is hourly-aggregated and the rate limit is low (10 requests per hour per team).

get/api/v2alpha/analytics/active-users

Query parameters

start_datestring date required

Start of the date range (inclusive) in YYYY-MM-DD format.

end_datestring date required

End of the date range (inclusive) in YYYY-MM-DD format. The range must not exceed 90 days.

product'agent' required

Product to query active users for.

granularity'daily' | 'monthly'

Time granularity for grouping results. When specified, each row includes a timestamp field. If omitted, the active user count is aggregated across the entire date range.

group_by'user'

Dimension to group results by. The active users endpoint only supports user, which returns one row per active user (each with active_users = 1).

modelsstring

Comma-separated list of model UIDs to filter results to.

group_idstring

Filter results to users in a specific group. The service key must have access to this group.

user_idstring

Filter results to a specific user (auth UID).

page_sizeinteger

Maximum number of rows to return per page.

page_cursorstring

Opaque cursor from a previous response's pagination.next_page_cursor to fetch the next page.

Headers

If-None-Matchstring

ETag value from a previous response. If the data has not changed, the server returns 304 Not Modified.

Response

Active users data returned successfully.

Example response

{
  "data": [
    {
      "timestamp": "2026-05-01"
    }
  ]
}