Skip to content
Skip to Content
Coder Docs

Get group members AI spend

GET
/api/v2/groups/{group}/members/ai/spend

Returns aggregate AI spend attributed to the group per requested user. A maximum of 100 user IDs may be requested per call, and requests with more are rejected, so callers are expected to batch across multiple requests. User IDs that are not members of the group, or that the caller has no read access to, are silently omitted.

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

group*string

Group ID

Formatuuid

Query Parameters

user_ids*string

Comma-separated list of user IDs (maximum 100)

Response Body

OK

application/json
  1. response
members?array<>
period_end?string

PeriodEnd is the exclusive upper bound of the current budget period.

Formatdate-time
period_start?string

PeriodStart is the inclusive lower bound of the current budget period.

Formatdate-time

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X GET \	"$CODER_URL/api/v2/groups/{group}/members/ai/spend?user_ids={user_ids}" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
{  "members": [    {      "effective_budget": {        "limit_source": "user_override",        "spend_limit_micros": 0      },      "effective_group_id": "85e2b926-ddfb-4c66-b68e-b66e5acec6c0",      "group_budget": {        "limit_source": "user_override",        "spend_limit_micros": 0      },      "group_spend_micros": 0,      "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"    }  ],  "period_end": "2019-08-24T14:15:22Z",  "period_start": "2019-08-24T14:15:22Z"}