Skip to navigation

Read the caller's credit balance

The credit balance of the account that owns the API key, in abstract units (never money); the answer carries no account identifier. spendable_units is what a new submission may spend (units funded by test payments are excluded while enforced), enforced says whether a submission without the units is refused 402 INSUFFICIENT_CREDITS, and unit_costs is what one accepted job of each operation costs. Served only where the balance endpoint is enabled for your account. A ledger that cannot be read is a 503, never a zero balance.

Authentication

X-API-Keystring

API key for one environment of your account. Keep server-side; never expose in browser clients.

Response

Successful Response
as_ofdatetime

When the balance was read (UTC).

available_unitsinteger
Settled minus held, the ledger's available units. May be negative after an adjustment.
enforcedboolean

True when a submission without the units is refused 402 INSUFFICIENT_CREDITS.

held_unitsinteger
Units held by accepted, unsettled jobs.
low_balanceboolean

True when a low-balance threshold is configured and spendable_units is at or below it.

settled_unitsinteger
Grants and adjustments minus captured charges.
spendable_unitsinteger

Units a new submission may spend: available_units, minus test_funded_units when enforced is true.

test_funded_unitsinteger

Units funded by test payments. Not spendable while enforced is true.

unit_costsmap from strings to integers
Units one accepted job of each operation costs.
objectstringOptionalDefaults to credit_balance

Always credit_balance.

Errors

401
Unauthorized Error
403
Forbidden Error
503
Service Unavailable Error