Skip to main content
GET
Get credit balance
Returns the current credit balance for the authenticated user (or the user’s active organization, if applicable).
Pair this with POST /v1/nodes/estimate-credits to confirm there’s enough balance before kicking off an expensive run.

Authorizations

string
required
Bearer API key. Format: Bearer gx_your_api_key.

Response

number
Raw credit balance in microcredits. Divide by 1,000,000 to convert to millions. The existing numeric value and precision are unchanged.
string
Legacy balance in millions without a suffix (e.g. "1.23", "1.00"). Nonzero inputs retain two decimal places; zero returns "0". This existing field is unchanged for independently deployed clients. Its two-decimal precision can round small nonzero balances to "0.00". For precision-sensitive displays, derive millions from availableBalance and retain sufficient decimal places: a raw balance of 1000 is 0.001M credits, not zero.
boolean
true when the user’s (or org’s) subscription is currently active, even if its available balance is zero or negative. Subscription status and available balance are separate checks.
boolean
true when the returned balance belongs to an organization the user is a member of, rather than the user’s personal account.

Request

Response example

Errors

A confirmed inactive subscription returns HTTP 200 with availableBalance: 0 and hasActiveSubscription: false. If the balance or subscription status cannot be verified, the endpoint returns HTTP 503 with error code SERVICE_UNAVAILABLE instead of reporting an inactive subscription or zero balance. On a temporary failure, preserve the last successfully retrieved balance, mark it as unavailable or stale, and retry with backoff. Do not treat a failed lookup as proof that the user has no credits or needs a subscription. Check the HTTP status before consuming the balance fields.