Get user AI spend
GET
CoderSessionTokenheader
Coder-Session-Token<token>user*stringUser ID, username, or me
OK
application/json- response
current_spend_micros?integerCurrentSpendMicros 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, whether it came from a group budget or a user override. Null when no budget applies, leaving the user's spend unlimited.
effective_group_id?stringEffectiveGroupID is the group the spend is attributed to, falling back to the Everyone group when no budget applies. Null only when the user has no organization membership.
Format
uuidperiod_end?stringPeriodEnd is the exclusive upper bound of the current budget period.
Format
date-timeperiod_start?stringPeriodStart is the inclusive lower bound of the current budget period.
Format
date-timeuser_id?stringFormat
uuidThe samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X GET \ "$CODER_URL/api/v2/users/{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", "period_end": "2019-08-24T14:15:22Z", "period_start": "2019-08-24T14:15:22Z", "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"}