Errors
Use HTTP status codes, JSON bodies on REST 429/503, and WebSocket error frames to branch retries, backoff, and user messaging.
REST errors
Authenticated REST routes pass through metering after the API key guard. Common statuses:
- 401 — missing or invalid key.
- 403 — inactive key, or key not entitled for REST.
- 404 — route found but resource (symbol, bar) does not exist. NestJS JSON body:
{ "statusCode": 404, "message": "…" }(optionalerrorfield). - 429 — rate limit or monthly quota. JSON body distinguishes which.
- 503 — usage metering storage unavailable.
Rate limit exceeded (429)
{
"error": "REST_RATE_LIMIT_EXCEEDED",
"message": "rest rate limit exceeded",
"limitRps": 10,
"retryAfterMs": 250
}Monthly quota exceeded (429)
{
"error": "REST_QUOTA_EXCEEDED",
"message": "monthly REST quota exceeded",
"limit": 3000
}WebSocket upgrade errors
Invalid keys and connection caps are enforced before any WebSocket frames are exchanged. See Connection for full upgrade-time status codes.
Account connection limit (429)
{
"error": "WS_CONNECTION_LIMIT_EXCEEDED",
"message": "rate limit exceeded"
}WebSocket frame errors
Subscribe-time validation returns JSON text frames with type: "error" after the connection is established. The code field is machine-readable.
Symbol limit exceeded
{
"type": "error",
"event": "subscribe_failed",
"code": "SYMBOL_LIMIT_EXCEEDED",
"message": "rate limit exceeded"
}See WebSocket errors & troubleshooting for the full error code list.