Skip to main content

Errors

Connection (handshake) failures

If authorization fails, the WebSocket upgrade is rejected with an HTTP status before the connection opens:

StatusMeaningWhat to do
401 UnauthorizedMissing/invalid/expired key or ticket.Check the Authorization header; the key may be revoked or your subscription lapsed.
403 ForbiddenThe request is not permitted from this source.Server-to-server internal routes are IP-restricted; the public feed is not affected.
429 Too Many RequestsConnection-rate limit hit.Back off (with jitter) and retry.
503 Service UnavailableThe relay could not authorize you right now (e.g. it could not reach AlphaQuick to verify your key).Retry shortly. Fails closed by design.

Close codes

A connection can be closed after it opens for reasons such as:

  • Lease ended / key revoked / subscription lapsed — reconnect; if it keeps closing immediately, your access was withdrawn.
  • Cap reached — you exceeded a connection limit.
  • Slow consumer — you received a gap first; rebuild from the next snapshot and speed up your consumer.

Demo-ticket endpoint (POST /api/relay/demo-ticket)

StatusMeaning
200Ticket minted ({ ticket, symbol, channel, source, expiresInSecs }).
400Unsupported symbol/channel/source, or invalid body.
429Per-IP ticket rate limit. Wait and retry.
503Demo feed is disabled or unavailable.

General guidance

  • Treat any non-101 handshake as retryable only for 429/503; a persistent 401 means fix your credentials, not retry.
  • Always reconnect with backoff + jitter.
  • Preserve prices/sizes as strings; never round-trip them through a float.