Per-grant burndown + kind subtotals
const url = 'http://localhost:8080/v1/credits/grants/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:8080/v1/credits/grants/example \ --header 'Authorization: Bearer <token>'The customer’s credit blocks with drawdown state — granted /
drawn / remaining per grant, expiry, and remaining per currency
split by cost-basis class (commit = money-backed, promotional =
free, other = legacy/adjustments). include_exhausted=true adds
fully-drawn blocks for history. Each grant’s consumed_cents
also counts credit no invoice used: expired_cents, the part that
expired unused; retired_cents, commit credit taken back when the
invoice that funded it was voided or refunded by a credit note; and
deducted_cents, the part an operator deduction (a negative
adjustment) drew from this grant. The credit invoices actually used
is consumed_cents - expired_cents - retired_cents - deducted_cents.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”Grants with remaining + kind subtotals
A customer’s credit blocks, newest first, with the remaining credit added up by currency and kind.
object
One block of credit on a customer’s balance (a grant or a positive adjustment) and how much of it is left.
object
The ledger entry that added the credit.
grant or adjustment.
The block’s currency, uppercase.
Absent for unclassified credit.
The credit the block started with.
Everything drawn from the block: used by invoices, expired, retired and deducted.
The part that expired unused.
Commit credit taken back when the invoice that paid for it was voided, or refunded by a credit note.
The part an operator removed with a negative adjustment.
The credit can be drawn up to and including this instant; a period invoice draws it when its period ends at or before it. The dashboard sends the local midnight after the picked day.
For a commit block, the invoice that paid for it.
One entry per currency with credit left, ordered by currency.
object
Remaining credit the customer paid for (commit).
Remaining free credit (promotional).
Remaining credit with no kind, such as adjustments and credit-note credit.
Example
{ "grants": [ { "grant_kind": "commit" } ]}No customer with this ID in this tenant and mode.
object
object
One of invalid_request_error, authentication_error,
rate_limit_error or api_error. Every error the API
answers has this shape, including an unknown path (404,
code route_not_found) and a method the path does not take
(405, code method_not_allowed, with an Allow header).
The few exceptions are listed in docs/api-surface.md.
The request field the error is about. Sent only when the error
names one. A request body may hold only the fields its
operation lists, spelled and cased as listed: any other
field, or one the server sets (such as id), is refused
with 422 and param naming it. An operation with no request body lists no fields: send
no body, {} or null. The Stripe and Postmark webhooks and
the LiteLLM callback take their sender’s body as it comes.
Example
{ "error": { "type": "invalid_request_error" }}