Skip to content
Skip to Content
Coder Docs

Get group AI spend

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

Returns the AI spend limit and aggregate spend for the group.

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

group*string

Group ID

Formatuuid

Response Body

OK

application/json
  1. response
current_spend_micros?integer

CurrentSpendMicros is the group's spend over the current budget period.

group_id?string
Formatuuid
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
spend_limit_micros?integer

SpendLimitMicros is the group's configured AI spend budget per member. Null when the group has no configured budget.

total_spend_limit_micros?integer

TotalSpendLimitMicros is the currently configured combined budget of the members attributed to this group, with each member's override replacing their share. Null when the group has no budget, and zero when no members are attributed to it.

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

curl -X GET \	"$CODER_URL/api/v2/groups/{group}/ai/spend" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
{  "current_spend_micros": 0,  "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",  "period_end": "2019-08-24T14:15:22Z",  "period_start": "2019-08-24T14:15:22Z",  "spend_limit_micros": 0,  "total_spend_limit_micros": 0}