Requests and responses
HTTP status mapping
HTTP status follows error.code; use the code for application branching.
Overview
HTTP status is derived from error.code (or an explicit override). Prefer the machine code when writing client logic—the status is for HTTP tooling and observability.
Common mappings
| Family | HTTP | Example codes |
|---|---|---|
| Auth | 401 | unauthorized, revoked_secret |
| Policy / plan | 403 | forbidden, blacklisted, plan_chain_denied, plan_feature_denied, chain_disabled |
| Client input | 400 | invalid_argument, unsupported_capability, prices_batch_limit |
| Not found / gone | 404 / 410 | not_found, gone |
| Credits | 402 | credits_exhausted |
| Conflict and state | 409 | conflict, needs_wallet_sync, plan_limit_* |
| Body too large | 413 | invalid_argument |
| Rate limit | 429 | rate_limit_exceeded |
| Not implemented | 501 | not_implemented |
| Unavailable | 503 | provider_unavailable, *_unavailable |
| Server | 500 | internal |
Unknown or future codes default to HTTP 400 unless the thrower sets status explicitly. Full table: Error codes catalog.