Errors
Connection (handshake) failures
If authorization fails, the WebSocket upgrade is rejected with an HTTP status before the connection opens:
| Status | Meaning | What to do |
|---|---|---|
401 Unauthorized | Missing/invalid/expired key or ticket. | Check the Authorization header; the key may be revoked or your subscription lapsed. |
403 Forbidden | The request is not permitted from this source. | Server-to-server internal routes are IP-restricted; the public feed is not affected. |
429 Too Many Requests | Connection-rate limit hit. | Back off (with jitter) and retry. |
503 Service Unavailable | The 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
gapfirst; rebuild from the next snapshot and speed up your consumer.
Demo-ticket endpoint (POST /api/relay/demo-ticket)
| Status | Meaning |
|---|---|
200 | Ticket minted ({ ticket, symbol, channel, source, expiresInSecs }). |
400 | Unsupported symbol/channel/source, or invalid body. |
429 | Per-IP ticket rate limit. Wait and retry. |
503 | Demo feed is disabled or unavailable. |
General guidance
- Treat any non-
101handshake as retryable only for429/503; a persistent401means fix your credentials, not retry. - Always reconnect with backoff + jitter.
- Preserve prices/sizes as strings; never round-trip them through a float.