Skip to content
Skip to Content
Coder Docs

Get organization member AI spend

GET
/api/v2/organizations/{organization}/members/{user}/ai/spend

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

organization*string

Organization ID or name

user*string

User ID, username, or me

Response Body

OK

application/json
  1. response
current_spend_micros?integer

CurrentSpendMicros is the user's spend on their effective group over the current budget period.

effective_budget?

EffectiveBudget is the spend limit that applies to the user in this organization. Null when no budget applies, leaving the user's spend unlimited.

effective_group_id?string

EffectiveGroupID is the group inside this organization that the spend is attributed to, falling back to the organization's Everyone group when no budget applies.

Formatuuid
organization_id?string
Formatuuid
period_end?string

PeriodEnd is the exclusive upper bound of the applied period.

Formatdate-time
period_start?string

PeriodStart is the inclusive lower bound of the applied period.

Formatdate-time
user_id?string
Formatuuid

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

curl -X GET \	"$CODER_URL/api/v2/organizations/{organization}/members/{user}/ai/spend" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
{  "current_spend_micros": 0,  "effective_budget": {    "limit_source": "user_override",    "spend_limit_micros": 0  },  "effective_group_id": "85e2b926-ddfb-4c66-b68e-b66e5acec6c0",  "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",  "period_end": "2019-08-24T14:15:22Z",  "period_start": "2019-08-24T14:15:22Z",  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"}