Get the account balance
Returns the account’s credit balance. The response carries a single key,
balance, holding the credits the account has left.
Requires a provisioning key.
balance crosses the wire as a decimal string, "12.3456789012" rather than
12.3456789012. Credits are a decimal quantity, and a JSON number would round
them in a client that parses numbers as binary floats. Parse the value with a
decimal type, and serialize it back as a string.
The balance governs access to paid models. A request for a paid model is
admitted while the balance is above zero. At zero or below, /v1/models lists
only the free models to that account. Free models do not consult the balance.
A per-key spending cap is separate and does not appear here. Each API key may
carry its own credit_limit, reported by /v1/account/keys, bounding what that
key may spend out of this balance.
Every response below 200 carries an object under error with a
machine-readable type and a human-readable message. Three statuses reach
this operation, and it has no rate limit.
401— the provisioning key is missing, unknown, or disabled. An ordinary API key returns the same status.500— a failure of the gateway itself.503— a store this operation depends on did not answer.Retry-Aftercarries the seconds to wait.
Authorizations
An account provisioning key. Send it as Authorization: Bearer <key>. Provisioning keys manage the account and cannot reach a model.
Response
The account's credit balance, as a decimal string.
The body of GET /v1/account/balance.
The account's credit balance, as a decimal STRING — a JSON number would round it. A request for a paid model is admitted only while this is above zero; free models do not consult it.