Summary
On the current credit-based Pro plan, GET /api/v1/accounts (and GET /api/v1/accounts/{account_id}) returns capabilities.credits.used: 0 regardless of actual usage. The included value is correct (3000 for our Pro plan), but used never increments, so the field is effectively dead for any dashboard or alerting built on top of the public API.
The Netlify billing UI (app.netlify.com/teams/<slug>/billing/general) clearly has this data: it shows a full "Credit usage breakdown" (production deploys, bandwidth, web requests, compute, etc.) and a "Total credits consumed" figure. So the data exists server-side, it just is not surfaced through the documented REST endpoint that looks like it should carry it.
Reproduction
-
Authenticate as admin of a team on the credit-based Pro plan with non-zero usage in the current billing period.
-
curl -H "Authorization: Bearer $TOKEN" https://api.netlify.com/api/v1/accounts
-
Observe:
"credits": {
"included": 3000,
"used": 0
}
-
Compare with the billing UI for the same account and billing period, which shows a non-zero "Total credits consumed" (in our case, 714.5 / 3000 for the Apr 3 to May 2 period).
Expected
Either capabilities.credits.used reflects actual consumption for the current billing period, or a dedicated endpoint exposes the same breakdown the billing UI shows. The first option is probably the smaller change and is enough for most API consumers.
Summary
On the current credit-based Pro plan,
GET /api/v1/accounts(andGET /api/v1/accounts/{account_id}) returnscapabilities.credits.used: 0regardless of actual usage. Theincludedvalue is correct (3000 for our Pro plan), butusednever increments, so the field is effectively dead for any dashboard or alerting built on top of the public API.The Netlify billing UI (
app.netlify.com/teams/<slug>/billing/general) clearly has this data: it shows a full "Credit usage breakdown" (production deploys, bandwidth, web requests, compute, etc.) and a "Total credits consumed" figure. So the data exists server-side, it just is not surfaced through the documented REST endpoint that looks like it should carry it.Reproduction
Authenticate as admin of a team on the credit-based Pro plan with non-zero usage in the current billing period.
curl -H "Authorization: Bearer $TOKEN" https://api.netlify.com/api/v1/accountsObserve:
Compare with the billing UI for the same account and billing period, which shows a non-zero "Total credits consumed" (in our case, 714.5 / 3000 for the Apr 3 to May 2 period).
Expected
Either
capabilities.credits.usedreflects actual consumption for the current billing period, or a dedicated endpoint exposes the same breakdown the billing UI shows. The first option is probably the smaller change and is enough for most API consumers.