WebSocket Protocol
The SimpleClaw Gateway uses a binary WebSocket protocol for all client-server communication. The protocol supports request/response patterns and server-pushed events.Connection Flow
Open WebSocket Connection
Connect to the Gateway WebSocket endpoint:Remote connections: Use Tailscale Serve/Funnel for WSS:
Frame Types
Request Frame
Client-to-server method invocation:Response Frame
Server response to a request:Event Frame
Server-pushed events (no request):Common Events
chat Event
Agent conversation events:
agent Event
Agent state changes:
tick Event
Periodic heartbeat:
shutdown Event
Gateway restart notification:
Error Codes
Common error codes returned inErrorShape:
| Code | Description | Retryable |
|---|---|---|
INVALID_PARAMS | Invalid request parameters | No |
METHOD_NOT_FOUND | Unknown method | No |
PERMISSION_DENIED | Insufficient permissions | No |
RATE_LIMITED | Too many requests | Yes |
TIMEOUT | Request timed out | Yes |
INTERNAL_ERROR | Server error | Maybe |
AGENT_NOT_FOUND | Unknown agent ID | No |
SESSION_NOT_FOUND | Unknown session key | No |
Message Size Limits
Default policy fromHelloOk:
maxPayload returns PAYLOAD_TOO_LARGE error.
Client Implementation
Reconnection Strategy
Next Steps
Protocol Reference
Complete schema documentation for all methods
Build a Client
SDK reference for custom integrations