Get Credit Grants and Statistics
Use the Cribl API to get credit grants and credit balance and consumption totals for an Organization.
To get cumulative credit consumption by contract, see Get Cumulative Consumption by Contract. To get per-product and Worker Group infrastructure credit consumption, see Get Monthly or Daily Credit Consumption.
For information about viewing billing and credit consumption data in Cribl, see Track Product Usage and Credit Consumption.
About Code Examples
Code examples use Bearer token authentication. Read the API authentication documentation to learn how to configure authentication. The API Credential that you use to obtain the Bearer token must have the necessary Permissions for the operations in code examples: Billing Reader, Admin, or Owner. Billing API requests return data only for the Organization associated with the API Credential.
Replace the variables in code examples with the corresponding information for your Cribl deployment.
Billing and FinOps API operations are available only on Cribl.Cloud, so this page does not include examples for on-prem deployments.
Code examples do not include all available parameters. For a complete list of parameters for specific endpoints, refer to the documentation in the API Reference.
Get Credit Grants
Use GET /billing/credits/grants to get credit grants for the Organization’s current contract (purchases, rollovers, and refunds).
The request URL must include each of the following query parameters, although the values do not affect the content of the response. The response always includes the current contract’s grant ledger, not a list of grants partitioned by a specific granularity or filtered to a requested date range.
startingOn: This example uses2026-05-01T00:00:00.000Z.endingBefore: This example uses2026-06-01T00:00:00.000Z.
curl --request GET \
--url "https://gateway.cribl.cloud/v1/organizations/${organizationId}/billing/credits/grants?startingOn=2026-05-01T00:00:00.000Z&endingBefore=2026-06-01T00:00:00.000Z" \
--header "Authorization: Bearer ${token}" \
--header "Accept: application/json"The response body contains an items array and a count field that lists the number of grants in items. Each object in items includes the following fields:
date: Date the grant was issued, in ISO 8601 format.creditsAcquired: Number of credits added by the grant.type: Category for the grant (Purchased,Rollover, orRefund).
{
"items": [
{
"date": "2025-09-17T00:00:00.000Z",
"creditsAcquired": 550000,
"type": "Purchased"
},
{
"date": "2025-09-17T00:00:00.000Z",
"creditsAcquired": 40000,
"type": "Rollover"
},
{
"date": "2026-03-10T00:00:00.000Z",
"creditsAcquired": 10000,
"type": "Refund"
}
],
"count": 3
}Get Credit Balance and Consumption Totals
Use GET /billing/credits/stats to get credit balance totals, consumption totals, and contract date ranges for the Organization’s current contract.
The request URL must include each of the following query parameters, although the values do not affect the content of the response. The response always reflects the current contract’s balance and consumption totals, not totals filtered to a requested date range.
startingOn: This example uses2026-05-01T00:00:00.000Z.endingBefore: This example uses2026-06-01T00:00:00.000Z.
curl --request GET \
--url "https://gateway.cribl.cloud/v1/organizations/${organizationId}/billing/credits/stats?startingOn=2026-05-01T00:00:00.000Z&endingBefore=2026-06-01T00:00:00.000Z" \
--header "Authorization: Bearer ${token}" \
--header "Accept: application/json"The response body includes the following fields:
totalCreditsRemaining: Credits remaining on the Organization’s current contract.totalCreditsUsed: Credits consumed on the Organization’s current contract.totalCreditsAcquired: Credits acquired on the Organization’s current contract.contracts: Array of contract periods. Each object can include the following fields:startDate: Start of the contract period, in ISO 8601 format.endDate: End of the contract period, in ISO 8601 format.
{
"totalCreditsRemaining": 223476.1392333599,
"totalCreditsUsed": 376523.8607666401,
"totalCreditsAcquired": 600000,
"contracts": [
{
"startDate": "2025-09-17T00:00:00.000Z",
"endDate": "2026-09-18T00:00:00.000Z"
}
]
}