API Reference
Errors

Error Handling

All errors follow a consistent JSON shape:

{ "error": "human-readable description or error code" }

Some errors include additional context fields (trade_id, code, etc.).

Auth errors

StatusError codeWhat it means
401invalid_api_keyKey not found or malformed
401api_key_expiredKey has passed its expires_at timestamp
401api_key_revokedKey was explicitly revoked
403ip_not_allowedRequest came from an IP not in the key's allowlist
403insufficient_scopeKey lacks the required scope for this endpoint
403privy_requiredEndpoint requires Privy JWT (e.g. wallet/credential management)
429api_key_rate_limitedPer-key rate limit exceeded
429too_many_failed_attemptsToo many failed auth attempts from this IP — blocked for 15 minutes (Retry-After: 900)
429rate_limit_exceededGeneral per-IP or per-user request limit hit (applies to all requests, authenticated or not)

Trade errors

StatusErrorWhat it means
400Various validation errorsMissing required fields, invalid enum values, missing idempotency key, etc.
404trade not foundTrade ID doesn't exist OR belongs to another user
200"idempotent": true in bodyNot an error: the idempotency key was used before — returns the original trade_id
409max N concurrent maker trades on {exchange} — already has M activePer-(wallet, maker-exchange) concurrency cap hit; N varies by venue
503system is in maintenance mode ("code": "system_maintenance")System is in full maintenance
503{exchange} is in maintenance modeA specific exchange is in maintenance and you tried to use it

Account errors

StatusErrorWhat it means
400invalid wallet addressFormat check failed (not a hex address, wrong length)
403privy_requiredWallet/credential mutations require browser auth

Server errors

StatusErrorWhat it means
500Short handler-specific message (e.g. failed to create trade)Internal error. The API returns a brief generic string, never internal exception details; the real cause is logged server-side
502(generic)Upstream / load balancer issue. Retry with backoff.
503system is in maintenance modeSee "Trade errors" above
504(generic)Request timeout. Some endpoints (e.g. event polls during high load) can occasionally time out; retry.

Retry guidance

  • Transient 5xx — exponential backoff with jitter. Start at 1s, double up to 30s.
  • 429 — back off; the rate-limit window resets within ~1s for per-key limits. too_many_failed_attempts blocks last 15 minutes — fix the credential rather than retrying.
  • 401 invalid_api_key — don't retry. Investigate the key.
  • 401 api_key_expired — don't retry; the key needs replacing.
  • 404 trade not found — don't retry; verify the trade_id.
  • Idempotent replay (200 with idempotent: true) — treat as success.