ListEnterpriseUserCreditUsage
Lists per-user month-to-date credit usage with effective monthly budgets.
Results are ordered by total credits descending so the highest spenders appear first, with user_id as a stable tiebreaker. Use cursor pagination to walk the full set for large organizations.
The default SORT_FIELD_USAGE ordering supports cursor pagination over any number of users. Sorting by display name, budget, or budget utilization computes the order in memory and is limited to organizations with at most 10,000 users; beyond that, use SORT_FIELD_USAGE. Because month-to-date figures are recomputed per request, hold a date range stable across a paginated walk to keep page tokens valid.
Use this method to:
- Export per-user credit usage to external reporting
- Identify the highest spenders in the organization
- Track per-user budget utilization and over-budget users
Examples
-
List user usage for the current month:
organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 50
Authorization
Requires billing:read_usage permission on the organization.
Body ParametersJSON
ListEnterpriseUserCreditUsage
curl https://app.gitpod.io/api/gitpod.v1.BillingService/ListEnterpriseUserCreditUsage \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $GITPOD_API_KEY" \
-d '{
"organizationId": "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
}'{
"pagination": {
"nextToken": "nextToken"
},
"totalCount": 0,
"userUsage": [
{
"budgetSource": "ENTERPRISE_AI_USER_BUDGET_POLICY_SOURCE_UNSPECIFIED",
"creditBudget": "creditBudget",
"displayName": "displayName",
"isServiceAccount": true,
"monthToDateUsage": {
"totalCredits": 0,
"usageByType": [
{
"credits": 0,
"usageType": "USAGE_TYPE_UNSPECIFIED"
}
]
},
"noCap": true,
"overBudget": true,
"usageByModel": [
{
"model": "model",
"unpricedUsage": {
"costMicrounits": "costMicrounits",
"credits": 0,
"currency": "BILLING_CURRENCY_UNSPECIFIED",
"tokens": {
"cacheTokens": "cacheTokens",
"inputTokens": "inputTokens",
"outputTokens": "outputTokens",
"totalTokens": "totalTokens"
}
},
"unpricedUsageByTokenType": [
{
"tokenType": "BYOK_RATE_CARD_TOKEN_TYPE_UNSPECIFIED",
"usage": {
"costMicrounits": "costMicrounits",
"credits": 0,
"currency": "BILLING_CURRENCY_UNSPECIFIED",
"tokens": {
"cacheTokens": "cacheTokens",
"inputTokens": "inputTokens",
"outputTokens": "outputTokens",
"totalTokens": "totalTokens"
}
}
}
],
"usage": {
"costMicrounits": "costMicrounits",
"credits": 0,
"currency": "BILLING_CURRENCY_UNSPECIFIED",
"tokens": {
"cacheTokens": "cacheTokens",
"inputTokens": "inputTokens",
"outputTokens": "outputTokens",
"totalTokens": "totalTokens"
}
},
"usageByTokenType": [
{
"tokenType": "BYOK_RATE_CARD_TOKEN_TYPE_UNSPECIFIED",
"usage": {
"costMicrounits": "costMicrounits",
"credits": 0,
"currency": "BILLING_CURRENCY_UNSPECIFIED",
"tokens": {
"cacheTokens": "cacheTokens",
"inputTokens": "inputTokens",
"outputTokens": "outputTokens",
"totalTokens": "totalTokens"
}
}
}
]
}
],
"userId": "userId",
"utilizationPercent": 0
}
]
}Returns Examples
{
"pagination": {
"nextToken": "nextToken"
},
"totalCount": 0,
"userUsage": [
{
"budgetSource": "ENTERPRISE_AI_USER_BUDGET_POLICY_SOURCE_UNSPECIFIED",
"creditBudget": "creditBudget",
"displayName": "displayName",
"isServiceAccount": true,
"monthToDateUsage": {
"totalCredits": 0,
"usageByType": [
{
"credits": 0,
"usageType": "USAGE_TYPE_UNSPECIFIED"
}
]
},
"noCap": true,
"overBudget": true,
"usageByModel": [
{
"model": "model",
"unpricedUsage": {
"costMicrounits": "costMicrounits",
"credits": 0,
"currency": "BILLING_CURRENCY_UNSPECIFIED",
"tokens": {
"cacheTokens": "cacheTokens",
"inputTokens": "inputTokens",
"outputTokens": "outputTokens",
"totalTokens": "totalTokens"
}
},
"unpricedUsageByTokenType": [
{
"tokenType": "BYOK_RATE_CARD_TOKEN_TYPE_UNSPECIFIED",
"usage": {
"costMicrounits": "costMicrounits",
"credits": 0,
"currency": "BILLING_CURRENCY_UNSPECIFIED",
"tokens": {
"cacheTokens": "cacheTokens",
"inputTokens": "inputTokens",
"outputTokens": "outputTokens",
"totalTokens": "totalTokens"
}
}
}
],
"usage": {
"costMicrounits": "costMicrounits",
"credits": 0,
"currency": "BILLING_CURRENCY_UNSPECIFIED",
"tokens": {
"cacheTokens": "cacheTokens",
"inputTokens": "inputTokens",
"outputTokens": "outputTokens",
"totalTokens": "totalTokens"
}
},
"usageByTokenType": [
{
"tokenType": "BYOK_RATE_CARD_TOKEN_TYPE_UNSPECIFIED",
"usage": {
"costMicrounits": "costMicrounits",
"credits": 0,
"currency": "BILLING_CURRENCY_UNSPECIFIED",
"tokens": {
"cacheTokens": "cacheTokens",
"inputTokens": "inputTokens",
"outputTokens": "outputTokens",
"totalTokens": "totalTokens"
}
}
}
]
}
],
"userId": "userId",
"utilizationPercent": 0
}
]
}