Gateway

Gateway protocol

The Gateway WS protocol is the single control plane and node transport for OpenClaw. Operator and node clients (CLI, web UI, macOS app, iOS/Android nodes, headless nodes) connect over WebSocket and declare a role and scope at handshake time.

Agent tools running inside a Gateway dispatch requests directly through that Gateway's router. They retain method scopes, agent and approval authority, request deadlines, and cancellation without opening another WebSocket. Explicit Gateway URL or token overrides, standalone agents, and separate client processes continue to use the WebSocket transport.

Scope

This protocol exposes the full gateway API: status, channels, models, chat, agent, sessions, nodes, approvals, and more. The exact surface is defined by the TypeBox schemas re-exported from packages/gateway-protocol/src/schema.ts.

What each page covers

  • Transport and framing — gateway WS transport: packages, frame shapes, limits, and WebRTC Talk control.
  • Handshake and roles — connect frame, hello-ok payload, client capabilities, roles, and scopes.
  • Presence and events — presence snapshots, node host stats, and broadcast event scoping.
  • RPC methods — RPC method families, discovery, session list bootstrap, and event families.
  • Ledger RPCs — audit ledger and task ledger RPCs, their scopes, cursors, and payloads.
  • Operator methods — operator helper methods, exec approvals, and agent delivery fallback.
  • Versioning — protocol version constants, the N-1 node window, and client defaults.
  • Auth and device identity — handshake auth paths, device identity, pairing signatures, and TLS pinning.

Where each section moved

Every section heading from the previous single-page version keeps its anchor here, so an existing link to this page with a fragment still resolves. Each entry points at the page that now holds the content.

Was this useful?
On this page

On this page