Skip to content
Skip to Content
Coder Docs

Get organization groups AI spend

GET
/api/v2/organizations/{organization}/groups/ai/spend

Returns AI spend limits and aggregate spend for the requested groups. A maximum of 100 group IDs may be requested per call, and requests with more are rejected, so callers are expected to batch across multiple requests. Unknown or unreadable group IDs are silently omitted.

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

organization*string

Organization ID

Formatuuid

Query Parameters

group_ids*string

Comma-separated list of group IDs (maximum 100)

Response Body

OK

application/json
  1. response
groups?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/organizations/{organization}/groups/ai/spend?group_ids={group_ids}" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
{  "groups": [    {      "current_spend_micros": 0,      "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",      "spend_limit_micros": 0,      "total_spend_limit_micros": 0    }  ],  "period_end": "2019-08-24T14:15:22Z",  "period_start": "2019-08-24T14:15:22Z"}