{"message": "<reason>"}. This page lists the ones that depend on your account state (balance, tier, rate) rather than request validity. Request-validity errors (400, 404, 410, 502, 503) are documented inline on each API reference page.
402 Insufficient balance
Returned on any billable endpoint whensandbox_free_micros + balance_micros ≤ 0 (for sandbox operations) or guardrails_free_micros + balance_micros ≤ 0 (for guardrails operations).
POST /sandboxes, command endpoints, filesystem endpoints, and guardrails-scanning paths for Pro and Enterprise accounts. Free accounts hit 402 only after their free credits are fully drained.
Recommended handling: surface to the user as “top up required”, then retry after a deposit lands. Deposits are processed synchronously — a successful POST /accounts/{id}/deposits immediately updates balance_micros.
403 Tier limit exceeded
Returned when a create request asks for resources above your tier cap. The request body is rejected before the sandbox is provisioned.{"message": "unknown tier: <name>"}— the account’s tier doesn’t map to a known config (administrative error, contact support){"message": "forbidden: cannot access another account"}— calling an/accounts/{id}endpoint with a different owner_id
429 Too many requests
Returned in two different scenarios. Both have the same status code but different meanings.Concurrent sandbox cap
MaxConcurrent sandboxes in the running state. Kill or let a sandbox time out before creating another.
Request rate limit
Fixed-bucket rate limits
A handful of sensitive endpoints have lower, fixed budgets that apply regardless of tier:| Bucket | Scope | Limit |
|---|---|---|
| Deposit | per account | 10 / hour |
| Tier change | per account | 5 / day |
| Account create | per client IP | 5 / hour |
| Login | per client IP | 10 / 15 minutes |
{"message": "too many ... requests, try again later"} response.
Response headers
General and create rate-limit rejections include per-bucket accounting headers:Declaw does not currently emit a
Retry-After header. Clients should use a fixed 1-second backoff for general/create rate-limit errors, and progressive backoff (e.g. 30s, 60s, 120s) for fixed-bucket errors.Recommended client-side handling
A production client should distinguish these three cases:Checklist
- Always handle
429with a retry — it’s transient by definition - Never retry
402without topping up — you’ll just burn quota against the same empty wallet - Never retry
403without changing the request — the tier cap won’t move on its own - Cache tier limits from Plans & Limits client-side; clamp request parameters before sending
- Alert on unexpected
402as early as possible — your account is locked out of billable operations until a deposit succeeds