## GetCumulativeCreditUsage **post** `/gitpod.v1.BillingService/GetCumulativeCreditUsage` Returns cumulative credit usage for an organization and its teams. Use this method to: - Get the total cumulative credit consumption as of a point in time - Get per-team cumulative usage with credit allocation (budget) comparison - Display team credit summaries on the usage page and team detail page - Display user budget utilization when user budgets are enabled ### Examples - Get current cumulative usage: ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` - Get cumulative usage as of a specific date: ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" asOf: "2026-03-31T23:59:59Z" ``` ### Authorization Requires `billing:read_usage` permission on the organization. ### Body Parameters - `organizationId: string` organization_id is the ID of the organization to get cumulative usage for. - `asOf: optional string` as_of is the point in time to compute cumulative usage up to. Defaults to now if not set. ### Returns - `orgUsage: optional CumulativeCreditUsage` Org-wide cumulative usage, broken down by type and total. - `totalCredits: optional number` Total credits consumed. - `usageByType: optional array of CreditsByType` Credits consumed broken down by usage type. - `credits: optional number` - `usageType: optional UsageType` UsageType identifies the category of usage. - `"USAGE_TYPE_UNSPECIFIED"` - `"USAGE_TYPE_ENVIRONMENT"` - `"USAGE_TYPE_AGENTIC"` - `periodStart: optional string` Start of the cumulative calculation period. Cumulative totals are computed from this date forward. - `teamUsage: optional array of TeamCumulativeCreditUsage` Per-team cumulative usage with credit allocation comparison. Returns all teams (no top-N limit). - `creditBudget: optional string` The team's credit allocation (budget) in whole credits, if set. Not set means no allocation has been configured for this team. - `displayName: optional string` - `teamId: optional string` - `usage: optional CumulativeCreditUsage` Cumulative credit usage for this team. - `unteamedUsage: optional CumulativeCreditUsage` Usage by members not assigned to any team. - `userUsage: optional array of UserCreditBudgetUsage` Per-user month-to-date usage for every user with usage in the period. The budget fields on each entry are populated only when a monthly budget applies to that user. This list is not paginated or capped; for large organizations prefer ListEnterpriseUserCreditUsage. - `budgetSource: optional EnterpriseAIUserBudgetPolicySource` - `"ENTERPRISE_AI_USER_BUDGET_POLICY_SOURCE_UNSPECIFIED"` - `"ENTERPRISE_AI_USER_BUDGET_POLICY_SOURCE_NONE"` - `"ENTERPRISE_AI_USER_BUDGET_POLICY_SOURCE_ORGANIZATION"` - `"ENTERPRISE_AI_USER_BUDGET_POLICY_SOURCE_USER"` - `creditBudget: optional string` - `displayName: optional string` - `isServiceAccount: optional boolean` True when user_id refers to a service account rather than a human user. The dashboard uses this to mark non-human accounts in admin tables. - `monthToDateUsage: optional CumulativeCreditUsage` CumulativeCreditUsage contains cumulative credit consumption totals. - `noCap: optional boolean` - `overBudget: optional boolean` - `usageByModel: optional array of EnterpriseAIUsageByModel` Month-to-date intelligence usage broken down by model. - `model: optional string` - `unpricedUsage: optional EnterpriseAIUsage` Usage excluded from spend because no matching BYOK rate was configured. - `costMicrounits: optional string` - `credits: optional number` - `currency: optional BillingCurrency` - `"BILLING_CURRENCY_UNSPECIFIED"` - `"BILLING_CURRENCY_USD"` - `"BILLING_CURRENCY_EUR"` - `"BILLING_CURRENCY_GBP"` - `tokens: optional EnterpriseAITokenUsage` - `cacheTokens: optional string` - `inputTokens: optional string` - `outputTokens: optional string` - `totalTokens: optional string` - `unpricedUsageByTokenType: optional array of EnterpriseAIUsageByTokenType` - `tokenType: optional ByokRateCardTokenType` - `"BYOK_RATE_CARD_TOKEN_TYPE_UNSPECIFIED"` - `"BYOK_RATE_CARD_TOKEN_TYPE_INPUT"` - `"BYOK_RATE_CARD_TOKEN_TYPE_OUTPUT"` - `"BYOK_RATE_CARD_TOKEN_TYPE_CACHE_READ"` - `"BYOK_RATE_CARD_TOKEN_TYPE_CACHE_WRITE"` - `usage: optional EnterpriseAIUsage` - `usage: optional EnterpriseAIUsage` - `usageByTokenType: optional array of EnterpriseAIUsageByTokenType` - `tokenType: optional ByokRateCardTokenType` - `usage: optional EnterpriseAIUsage` - `userId: optional string` - `utilizationPercent: optional number` ### Example ```http curl https://app.gitpod.io/api/gitpod.v1.BillingService/GetCumulativeCreditUsage \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $GITPOD_API_KEY" \ -d '{ "organizationId": "b0e12f6c-4c67-429d-a4a6-d9838b5da047" }' ``` #### Response ```json { "orgUsage": { "totalCredits": 0, "usageByType": [ { "credits": 0, "usageType": "USAGE_TYPE_UNSPECIFIED" } ] }, "periodStart": "2019-12-27T18:11:19.117Z", "teamUsage": [ { "creditBudget": "creditBudget", "displayName": "displayName", "teamId": "teamId", "usage": { "totalCredits": 0, "usageByType": [ { "credits": 0, "usageType": "USAGE_TYPE_UNSPECIFIED" } ] } } ], "unteamedUsage": { "totalCredits": 0, "usageByType": [ { "credits": 0, "usageType": "USAGE_TYPE_UNSPECIFIED" } ] }, "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 } ] } ```