GetCreditUsageExport
POST/gitpod.v1.BillingService/GetCreditUsageExport
Returns a signed download URL for a CSV export of credit usage.
The URL points to an HTTP endpoint that streams gzip-compressed CSV and is valid for five minutes. The download must be made by the same principal that requested it, carrying its own bearer token. The export range may cover up to a year.
For organizations without enterprise credit usage enabled (no billing contract start date), the export instead contains BYOK cost usage with a different column set, and groupBy=RESOURCE is rejected.
Use this method to:
- Export per-user daily credit usage for external reporting
- Export a per-environment and per-conversation resource breakdown
Examples
-
Export January’s daily summary:
organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" dateRange: startTime: "2024-01-01T00:00:00Z" endTime: "2024-01-31T00:00:00Z" groupBy: CREDIT_USAGE_EXPORT_GROUP_BY_DAILY_SUMMARY
Authorization
Requires billing:read_usage permission on the organization.
GetCreditUsageExport
curl https://app.gitpod.io/api/gitpod.v1.BillingService/GetCreditUsageExport \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $GITPOD_API_KEY" \
-d '{
"dateRange": {
"endTime": "2024-01-31T00:00:00Z",
"startTime": "2024-01-01T00:00:00Z"
},
"organizationId": "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
}'{
"downloadUrl": "downloadUrl"
}Returns Examples
{
"downloadUrl": "downloadUrl"
}