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.
/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
| Status | Meaning |
|---|---|
200 | The account view for the key you presented. |
401 | Missing, unknown or revoked key. A key minted moments ago can answer 401 until it propagates to the serving fleet. |
429 | 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. |
Response body
AccountStatus
| Name | Type | Description |
|---|---|---|
credits_remaining | integer | null | Credits left in the allowance, or `null` when `monthly_credits` is unlimited. |
credits_used_this_periodrequired | integer | Credits billed since `period_start_unix`. |
hard_caprequired | boolean | Whether the account stops (429) at `monthly_credits` rather than billing overage. A hard-capped key refuses a call it cannot afford in full. |
metered_billingrequired | boolean | Whether a payment method is attached — what decides between continuing past the allowance and stopping at it. |
monthly_creditsrequired | integer | Included credits per calendar month. `0` means unlimited. |
monthly_quotarequired | integer | Deprecated: `monthly_credits`. |
period_start_unixrequired | integer | First second of the current calendar month, in unix seconds. `credits_used_this_period` counts from here. |
planrequired | string | Plan name. |
quota_remaining | integer | null | Deprecated: `credits_remaining`. |
rate_per_minrequired | integer | Credits 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. |
tenantrequired | string | The account this key belongs to. |
usage_this_periodrequired | integer | Deprecated: `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.