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:| Your setup | How usage is metered | Use |
|---|---|---|
| BYOK (your own provider keys) | Spend in your billing currency, via BYOK rate cards | This API |
| Ona Intelligence (Ona-managed models) | Credits (OCUs) consumed as you use environments and AI | Ona Intelligence usage API |
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:| Parameter | Required | Description |
|---|---|---|
organizationId | Yes | Your organization ID. |
dateRange | Yes | startTime and endTime as RFC-3339 timestamps. Both dates are inclusive and the range must not exceed 31 days. Time-of-day is ignored; dates are truncated to midnight in the request timezone. |
timezone | No | IANA timezone name used to bucket usage (for example Europe/London). Defaults to UTC. |
pagination | List endpoints | pageSize and token for paging through results. |
- 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: