Get the organization's credit balance
/v1/billing/creditsGet the organization's credit balance.
Returns the organization's credit account: the USD balance that PLATFORM virtual keys draw on, what was bought and consumed, the auto-recharge settings and any pending withdrawal. An organization that has never bought credits gets an account with a balance of 0.
Requires a member of the organization (any role), or an organization-scoped va_ key with the admin or member role. A workspace-scoped key is refused with 403.
Authorization
AuthorizationBearer va_A platform API key (
va_...), created under Settings > API keys. Scoped to an organization or one workspace, with an admin or member role. Used by the management API.
Query parameters
organizationstringrequiredthe organization's slug
Responses
idstring<uuid>The account's id (UUID); absent for an organization that has never bought credits.
organizationstringThe slug of the organization.
balance_usdnumber<double>The credit left, in USD.
total_purchased_usdnumber<double>All credit added so far (purchases and auto-recharges), in USD.
total_consumed_usdnumber<double>All credit used by PLATFORM keys so far, in USD.
auto_recharge_enabledbooleanWhether credit is bought automatically when the balance falls below
auto_recharge_threshold_usd.auto_recharge_threshold_usdnumber<double>The balance, in USD, below which an auto-recharge is charged.
auto_recharge_amount_usdnumber<double>How much credit each auto-recharge buys, in USD.
has_payment_methodbooleanWhether a card is saved for auto-recharge (saved by a credit purchase).
has_billing_accountbooleanWhether the organization has a customer account with the payment provider, so the billing portal can be opened.
withdrawal_statusenum<string>PENDINGwhile a withdrawal of the balance is being refunded, elseNONE.One of
"NONE","PENDING"withdrawal_amount_usdnumber<double>The amount being withdrawn, in USD; absent when no withdrawal is pending.
withdrawal_initiated_atstring<date-time>When the pending withdrawal was started (ISO 8601 date-time); absent when none is pending.
created_atstring<date-time>When the account was created (ISO 8601 date-time).
updated_atstring<date-time>When the account last changed (ISO 8601 date-time).