Internal User management

User Info V2

Lightweight endpoint to get user info. Returns only the user object — no keys, no teams objects.

This is the v2 replacement for /user/info, designed to avoid the "god endpoint" problem where the old endpoint loaded all keys and teams into memory.

Note on spend: this is the user's running budget counter, which the budget reset job resets whenever budget_reset_at elapses (see budget_duration): to zero by default, or to the overage above max_budget when budget_rollover is enabled. It is NOT lifetime or per-period historical spend. For historical spend over a date range, use /user/daily/activity or /user/daily/activity/aggregated, which read daily spend records that only ever accumulate and are never reset. The two values are expected to diverge once a budget reset has occurred within the queried period.

Access control:

  • Proxy admins can query any user
  • Team admins can query users within their teams
  • Internal users can only query themselves (omit user_id or pass own)
  • Returns 404 for non-existent users or unauthorized access

Example request:

curl -X GET 'http://localhost:4000/v2/user/info?user_id=user123' \
--header 'Authorization: Bearer sk-1234'
get/v2/user/info

Query parameters

user_idstring nullable

User ID in the request parameters

User ID in the request parameters

Response

Successful Response

user_idstring required
user_emailstring nullable
user_aliasstring nullable
user_rolestring nullable
spendnumber
max_budgetnumber nullable
modelsstring[]
budget_durationstring nullable
budget_reset_atstring date-time nullable
metadataobject nullable
created_atstring date-time nullable
updated_atstring date-time nullable
sso_user_idstring nullable
teamsstring[]
model_max_budgetobject nullable
model_max_budget_usageobject nullable

Changes