error object. The API does not use the RFC 9457 application/problem+json shape — it returns the envelope below with Content-Type: application/json.
Error envelope
The
documentation_url is emitted for the authentication and request-level error codes (the Status codes table below). Some specialized surfaces — feature-gated endpoints and the events replay endpoint — return their own error shapes documented under Feature-gated and endpoint-specific errors. In every case, branch on code, never on the HTTP status or message alone.Status codes
Each row’scode is also a section anchor on this page, so https://docs.alterscope.org/errors/<code> deep-links here.
Rate-limit responses
A429 from the per-minute limiter additionally sets:
error.code is rate_limit_exceeded. Wait for the Retry-After period (seconds) before retrying. The X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset headers are returned on every response, not just 429s, so you can pace yourself before you hit the limit. See Rate limits for per-tier limits.
Feature-gated and endpoint-specific errors
A few endpoints enforce plan tiers, monthly quotas, or a tier-scoped data window. These return codes specific to the endpoint. They are not general status codes — only the listed endpoints emit them.Plan-gated and quota codes
These appear on the exit Monte Carlo (/v2/liquidity/{id}/exit-monte-carlo) and simulator (/v2/simulator/...) endpoints.
The plan-gated and quota codes use UPPER_SNAKE_CASE and carry context in
details (for example details.required_plans, details.limit, details.upgrade_url). They do not set documentation_url. Tier names are always one of Free / Analyst / Team / Enterprise / Custom — see Rate limits for per-tier limits.Events replay errors
The events replay endpoint (GET /v2/events/replay) enforces a tier-scoped replay window. Its error body is a flat shape — {"error": "<CODE>", "message": "…", "details": { … }} — rather than the nested error.code envelope above. Branch on the top-level error string.
Idempotency in-flight (409)
Endpoints protected by idempotency accept anX-Idempotency-Key header. If a request with the same key is still being processed by another worker, the API responds with 409 Conflict and a Retry-After: 1 header. The body is a flat {"error": "duplicate request in flight; retry after a brief delay"}.
- A replay of a completed request (same key, within the cache window) returns the original cached response with an
X-Idempotency-Replayed: trueheader — not a 409. - An in-flight duplicate returns the 409 above. Wait the
Retry-Afterinterval, then retry with the same key.
Retry guidance
429— back off for theRetry-Afterinterval, then retry. For idempotent writes, reuse the sameX-Idempotency-Key.500and other 5xx (including503unavailable/risk_dependency_unavailable) — retry with exponential backoff and a capped number of attempts.400,401,403,404— do not retry blindly; fix the request, key, scope, or path first.409— for an idempotency in-flight conflict, retry after the shortRetry-After. For a resourceconflict, reconcile state before retrying.
request_id (or the X-Request-ID header) so support can trace a specific failed call.