Available on the Enterprise plan. Contact sales to learn more.
credits field is never populated. For budget concepts, see User budgets.
Ona Intelligence or BYOK? Choose the right API
Ona meters AI usage one of two ways, depending on how your organization is set up. The two models have separate APIs:
Not sure which applies to you? Open Settings → Cost & Budgets: if usage is shown as spend in a currency (USD, EUR, or GBP), you are on BYOK (use this API); if it is shown in credits, you are using Ona Intelligence (use the Ona Intelligence usage API). The APIs also tell you directly: these cost endpoints return empty usage for organizations on Ona Intelligence, and the Ona Intelligence usage API returns
FAILED_PRECONDITION with enterprise credit usage is not enabled for BYOK-only organizations.
Authentication
All endpoints accept a Bearer token: a personal access token (acts as you) or a service account token (owned by the organization, recommended for ongoing automation).filter.subject to themselves on the per-user endpoints.
Request format
Every endpoint is a POST with a JSON body:
Responses follow three conventions:
- Costs are reported as
costMicrounits: millionths of the billingcurrencyunit, so"84500000"withBILLING_CURRENCY_USDis $84.50. Currencies areBILLING_CURRENCY_USD,BILLING_CURRENCY_EUR, orBILLING_CURRENCY_GBP. - 64-bit integer fields (costs, token counts, limits) are returned as JSON strings, per protobuf JSON encoding. Parse them as integers.
calculatedAtis the time through which usage has been calculated. Usage after that timestamp may still be processing, and fields with zero values are omitted from responses.
Organization usage summary
Returns organization-wide spend and token counts for the date range, the monthly budget when one applies, and a per-model breakdown. Usage that no configured BYOK rate matched is reported separately asunpricedUsage.
Endpoint: POST https://app.gitpod.io/api/gitpod.v1.BillingService/GetEnterpriseAIUsageSummary
Request:
budget is unset when no monthly budget applies to the organization. Token types are BYOK_RATE_CARD_TOKEN_TYPE_INPUT, BYOK_RATE_CARD_TOKEN_TYPE_OUTPUT, BYOK_RATE_CARD_TOKEN_TYPE_CACHE_READ, and BYOK_RATE_CARD_TOKEN_TYPE_CACHE_WRITE.
Per-team usage
Returns spend per team, with each team’s monthly budget when one applies. Filter to specific teams withfilter.teamIds (up to 100).
Endpoint: POST https://app.gitpod.io/api/gitpod.v1.BillingService/ListEnterpriseAITeamUsage
Request:
Per-user usage
Returns spend for each user and service account with attributed usage, including each subject’s effective monthly budget. Usage not attributed to a user or service account is excluded, so the sum across subjects can be less than the organization totals. Budget fields (monthToDateUsage, utilizationPercent, overBudget) are computed from usage inside the requested date range measured against the monthly limit. Send a range that starts on the first day of the month for true month-to-date figures.
Endpoint: POST https://app.gitpod.io/api/gitpod.v1.BillingService/ListEnterpriseAIUserUsage
Request (top spenders first):
SORT_FIELD_USAGE (default, spend), SORT_FIELD_DISPLAY_NAME, SORT_FIELD_BUDGET, SORT_FIELD_BUDGET_USED. Subjects without a budget sort last on the budget fields. noCap is true for subjects explicitly exempted from budget limits.
To restrict the list to one user or service account:
Daily time series
Returns one entry per day with spend totals and per-user, per-team, and per-model breakdowns. Per-user entries cover the top spenders, with the rest grouped into an “Others” bucket (emptyuserId).
When filter.subject is set, the response contains only that subject’s usage: daily totals and the team breakdown are omitted, and the model breakdown covers the subject only.
Endpoint: POST https://app.gitpod.io/api/gitpod.v1.BillingService/GetEnterpriseAIUsageTimeSeries
Request: