Skip to main content

Get Consumption (Admin)

Read consumption (credits + tool calls) for the calling org. Without user_id: org-wide ConsumptionStatus. With user_id: per-user breakdown. Requires an admin-scoped API key.

Parameters

NameTypeDefaultDescription
user_idstring-Optional UUID of a user. If provided, returns a per-user breakdown for that user. If omitted, returns the org-wide consumption status.
fromstring-ISO datetime; window start (default: org's current billing period start).
tostring-ISO datetime; window end (default: org's current billing period end).

Use Cases

  • How many credits has the org used this billing period, and how many remain?
  • Is the org over its plan limit and in hard-enforcement mode?
  • Break down a specific user's credit and tool-call usage over a date window

Example Usage

Org-wide consumption for the current billing period

{
"tool": "admin_get_consumption",
"arguments": {}
}

Per-user breakdown over an explicit window

{
"tool": "admin_get_consumption",
"arguments": {
"user_id": "3f7c2b1a-9d4e-4c2a-8b1f-0a1b2c3d4e5f",
"from": "2026-08-01T00:00:00Z",
"to": "2026-08-27T00:00:00Z"
}
}

Response Format

FieldTypeDescription
kindstringWhich variant this response is. org_wide (no user_id) populates status; per_user (user_id given) populates users, from, and to.
statusobjectOrg-wide ConsumptionStatus (same shape as the webapp consumption view). Present only when kind='org_wide'.
status.organizationSlugstring
status.organizationNamestring
status.planIdstring | null
status.planNamestring | null
status.billingPeriodobject | null
status.creditsobject
status.credits.usednumber
status.credits.limitnumber
status.credits.remainingnumber
status.credits.percentUsednumber
status.overageobject
status.overage.amountnumberOverage credits beyond the plan limit.
status.overage.costnumberOverage cost in cents.
status.enforcementModestring
status.isOverLimitboolean
status.isCustomPricingboolean
usersarrayPer-user credit and tool-call breakdown. Present only when kind='per_user'.
users[].userIdstring
users[].emailstring
users[].namestring | null
users[].callCountnumber
users[].creditsnumber
users[].byToolarray
users[].byTool[].toolNamestring
users[].byTool[].callCountnumber
users[].byTool[].creditsnumber
fromstringResolved window start (kind='per_user' only).
tostringResolved window end (kind='per_user' only).