APIAnalytics

LLM cost by group

Cost per user group over a time range, alongside how much of each group's seats are in use. A user who belongs to several groups has their cost split evenly across them, so group rows always sum to the org total. Usage from users with no group is returned in an Unassigned ("") row, which cannot be filtered to. Filtering by group narrows the split as well as the rows: only the selected groups come back, each charged its members' whole cost, and the rows still sum to the filtered total. Filters are limited to provider and user_group; for one person's cost, filter the per-user endpoints by user_id.

GET
/analytics/llm-cost-by-group

Cost per user group over a time range, alongside how much of each group's seats are in use. A user who belongs to several groups has their cost split evenly across them, so group rows always sum to the org total. Usage from users with no group is returned in an Unassigned ("") row, which cannot be filtered to.

Filtering by group narrows the split as well as the rows: only the selected groups come back, each charged its members' whole cost, and the rows still sum to the filtered total. Filters are limited to provider and user_group; for one person's cost, filter the per-user endpoints by user_id.

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

Bearer token authentication. Send an API key (a saai_api_-prefixed token) as Authorization: Bearer <token>.

Required permission

view_user_analytics

Query Parameters

start_time*string
Formatdate-time
end_time*string
Formatdate-time
provider?array<>
user_group?array<string>

Response Body

The request has succeeded.

application/json
  1. response

Per-group cost and adoption; even-split shares reconcile to org totals.

groups*array<>
total_seats*integer

Gateway users in the org matching the filters.

Formatint64
total_active*integer

Users at or above the 25th usage percentile among users with usage in the range.

Formatint64
seat_pricing_configured*boolean

False until seat pricing is configured; seat_spend is 0 then.

curl -X GET "https://example.com/analytics/llm-cost-by-group?start_time=2019-08-24T14%3A15%3A22Z&end_time=2019-08-24T14%3A15%3A22Z"
{  "groups": [    {      "group": "string",      "seats": 0,      "active_users": 0,      "adoption": 0.1,      "api_spend": 0.1,      "seat_spend": 0.1,      "real_spend": 0.1,      "per_active_user": 0.1    }  ],  "total_seats": 0,  "total_active": 0,  "seat_pricing_configured": true}