Skip to main content
RouteMesh supports real-time event streams over WebSocket using the standard Ethereum eth_subscribe / eth_unsubscribe protocol. This lets you receive pushed notifications — like new blocks or contract logs — without polling.

Connecting

Connect to the WebSocket URL with your API key in the path (same keys you use for HTTP RPC):
The connection must be upgraded from HTTP. On a successful handshake, the server returns an X-WebSocket-Session-ID header you can use for debugging. The handshake validates your API key, origin, and credit balance before the socket is upgraded. Common handshake failures return an HTTP status before upgrade:
  • 402 — Insufficient credits
  • 429 — Service draining or too many concurrent connections from your IP (a Retry-After header tells you when to retry)
  • 503 — All connection slots are currently in use
  • 401 — Unauthorized (invalid or inactive API key)

Subscribing and receiving notifications

To subscribe, send eth_subscribe with a subscription type:
The server replies with a subscription ID, then streams notifications to you as JSON-RPC eth_subscription messages:
To stop receiving events for a subscription, send eth_unsubscribe with the subscription ID.

Supported subscription types and pricing

The available subscription types (and their prices) can change as we add chains and providers, so instead of a static list use the live endpoints:
  • GET /pricing/ws — current WebSocket notification prices per chain and subscription type (price per million notifications)
  • GET /chains/ws — the chains currently supported over WebSocket

Reliability

RouteMesh runs WebSocket streams with the same redundancy we apply to HTTP RPC:
  • Seamless provider failover — if the upstream node behind your subscription goes down, RouteMesh transparently reconnects to an alternate provider while keeping your connection alive. You don’t need to re-subscribe.
  • Gap backfill and deduplication — when we fail over to an alternate provider, we replay any notifications missed during the switch, drop duplicate events, and keep the stream in order, so you don’t lose data while connected.
Because this recovery happens while your connection stays open, you get a durable event stream for the lifetime of the socket. If your client disconnects, subscriptions end with the connection — reconnect and re-subscribe to continue.