unlob Docs
Browse documentation

Your plan and usage this period — GET /account

Plan, per-minute rate, monthly credits, credits used this billing period, and whether metered billing is on.

get /account

Request

curl \
  -H "x-api-key: $UNLOB_API_KEY" \
  "https://api.unlob.com/account"

Behaviour

Free: it costs no credits, and it answers even when a hard-capped key has run out. It still takes one per-minute token and needs a key, since what it reports is that key's account. It is the cheapest way to know where you stand before a long run, and the only way to read your usage without opening the console.

Use it to pace a batch job rather than discovering the allowance by hitting it. `credits_remaining` says how much of the month you have left; the `x-ratelimit-remaining` header on every response says how much of the current minute, in credits.

Costs no credits.

Responses

StatusMeaning
200The account view for the key you presented.
401Missing, unknown or revoked key. A key minted moments ago can answer 401 until it propagates to the serving fleet.
429Over the per-minute rate (spent in credits), or a hard-capped key without the credits this call costs. `retry-after` is present on the rate-limit case only.

Response body

AccountStatus

NameTypeDescription
credits_remaininginteger | nullCredits left in the allowance, or `null` when `monthly_credits` is unlimited.
credits_used_this_periodrequiredintegerCredits billed since `period_start_unix`.
hard_caprequiredbooleanWhether the account stops (429) at `monthly_credits` rather than billing overage. A hard-capped key refuses a call it cannot afford in full.
metered_billingrequiredbooleanWhether a payment method is attached — what decides between continuing past the allowance and stopping at it.
monthly_creditsrequiredintegerIncluded credits per calendar month. `0` means unlimited.
monthly_quotarequiredintegerDeprecated: `monthly_credits`.
period_start_unixrequiredintegerFirst second of the current calendar month, in unix seconds. `credits_used_this_period` counts from here.
planrequiredstringPlan name.
quota_remaininginteger | nullDeprecated: `credits_remaining`.
rate_per_minrequiredintegerCredits per minute. A call takes its cost from the minute, and the window is shared by the whole serving fleet, so this is the figure you get.
tenantrequiredstringThe account this key belongs to.
usage_this_periodrequiredintegerDeprecated: `credits_used_this_period`.

See Errors for what to do with each status, and Retries and backoff for which are worth repeating.

FAQ

What does 200 mean on GET /account?
The account view for the key you presented.
What does 401 mean on GET /account?
Missing, unknown or revoked key. A key minted moments ago can answer 401 until it propagates to the serving fleet.
What does 429 mean on GET /account?
Over the per-minute rate (spent in credits), or a hard-capped key without the credits this call costs. `retry-after` is present on the rate-limit case only.