Skip to main content
Errors come from two places. The gateway decides authentication, access, billing, rate limiting and routing, and answers with one envelope. If the request gets past the gateway, the API you called may reject it in its own format. Key on the status code and the machine-readable code, never on the message text, which is prose and may be reworded.

Gateway errors

Two patterns worth recognising immediately:
  • 401 unauthenticated on every route almost always means the key is missing from the request, not that it is wrong.
  • 502 on everything means the gateway could not reach its authentication service. It fails closed by design. Retry with backoff.

Market Data errors

Live Availability errors

Watchlist errors

Validation errors carry error; a body that is not valid JSON is rejected earlier and carries detail.

Account errors

Stream errors

The WebSocket returns HTTP errors before the upgrade completes and sends no custom close frames afterwards. See Connecting to the stream.

Retry policy

Paid requests that fail with a 4xx from the API itself are still billed once, so a retry loop on a bad request spends credits for nothing.