Status codes
Billing guarantees on errors
- Failed requests are not charged. The flat $0.01 management charge settles only after the operation succeeds. A request rejected for a bad body (400/422), missing permission (403), or a server error (5xx) costs nothing.
- An invalid key is a 401, not a 402. You will only ever see
402 Payment Requiredfor an account that actually exists and is short on credits. - Billing outages are a 503, not a 402. If Stripe or the chain RPC is unreachable, the API tells you to retry — it does not tell you to pay.
Common sequences
“I created an account but every call says 402.” New accounts start with no credits unless the node grants starter credits. Running Lit Actions and write/metered management calls (creating wallets, groups, usage keys) consume credits; read-only calls (list_*, account_exists,
billing/balance) are free. Add funds to proceed.
“My key worked yesterday and now I get 401.”
The key was removed (remove_usage_api_key) or you’re sending a truncated
value. Keys are shown once at creation; verify with GET /core/v1/account_exists
and mint a new usage key from your account key if needed.
“The error body isn’t JSON.”
It is, as of API version v1.2. If you see an HTML error page you are talking
to something other than the API (a proxy, a wrong URL) — check the host and
path.