Skip to content

Broken: capabilities.credits.used on /accounts always returns 0 on credit-based Pro plan #640

@lima-zulu

Description

@lima-zulu

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

  1. Authenticate as admin of a team on the credit-based Pro plan with non-zero usage in the current billing period.

  2. curl -H "Authorization: Bearer $TOKEN" https://api.netlify.com/api/v1/accounts

  3. Observe:

    "credits": {                                                                                                                                                                                                                               
      "included": 3000,                                                                                               
      "used": 0
    }
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions