Error handling

Errors use a consistent JSON shape with a machine-readable code — over HTTP for REST, and as inline frames on an open stream connection.

REST errors

HTTP responses include a status code and a JSON body:

{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key."
  }
}
StatusCodeMeaning
400invalid_requestBad mint, param, source, batch size, or cursor.
401unauthorizedMissing or invalid API key.
404not_foundUnknown token or no price for mint.
429rate_limitedPer-key burst limit exceeded.
429quota_exceededPer-user monthly request quota exceeded.
500internalUnexpected server failure.
503upstream_unavailableDependency unavailable (e.g. metadata resolve).

Stream errors

Subscription rejections and protocol errors arrive as versioned JSON frames on the WebSocket. Most codes leave the connection open; unauthorized and slow_consumer close the socket after the error frame:

{
  "v": 1,
  "type": "error",
  "code": "plan_restricted",
  "message": "Your plan doesn't include this stream.",
  "id": "trades-1",
  "ts": 1783259497400
}
CodeMeaning
invalid_messageClient frame is not a recognized control message
invalid_filtersFilters fail schema or channel-specific rules
unknown_channelsubscribe.channel is not a v1 channel
subscription_limitActive subscriptions on that channel would exceed the account-wide connectionsPerStream cap
duplicate_idsubscribe.id already active on this connection
unknown_subscriptionunsubscribe.id is not active
unauthorizedAuth failed or revoked (closes socket)
slow_consumerClient outbound buffer exceeded (closes socket)
plan_restrictedPlan does not include the requested channel
internal_errorUnexpected server failure handling the message

Fatal closes use WebSocket codes 1008 (unauthorized), 1013 (slow consumer), and 1011 (internal) — see Close codes on the Streams page.