OpenClaw WebChat Channel
WebChat is the built-in chat interface for OpenClaw Gateway. It connects directly via WebSocket — no external services, API keys, or third-party accounts required. Simply start the Gateway, configure authentication, and open the WebChat UI to begin chatting with your AI assistant. All messages are routed deterministically, meaning replies always return to the WebChat session that initiated the conversation.
WebChat Supported Features
Text Messages
Supported
Media & Files
Not Supported
Reactions
Not Supported
Threads
Not Supported
Voice Messages
Not Supported
Group Chat
Not Supported
WebChat Prerequisites
- OpenClaw Gateway installed and running
- Gateway authentication configured (token or password mode)
- A modern web browser (Control UI) or the native macOS/iOS client
- Network access to the Gateway WebSocket port (default: 3000)
WebChat Quick Setup
Start the Gateway
Launch your OpenClaw Gateway. WebChat is built in — no separate installation or plugin is needed. Run 'openclaw start' to bring up the Gateway service.
Configure authentication
Set up gateway.auth.mode with either 'token' or 'password' authentication in your openclaw.json. Authentication is mandatory for all connections, including localhost.
Open WebChat
Access the WebChat interface through the Control UI chat tab in your browser, or launch the native macOS/iOS client. Connect to the Gateway at ws://localhost:3000 (or your configured host and port).
Start chatting
Send a test message to verify the connection. Your AI assistant will respond through the same WebChat session. Conversation history is managed by the Gateway and persists across reconnections.
WebChat Configuration Example
{
"gateway": {
"port": 3000,
"bind": "127.0.0.1",
"auth": {
"mode": "token",
"token": "YOUR_SECRET_TOKEN"
}
}
}
WebChat Deep Dive
Architecture Overview
Gateway Authentication
{
"gateway": {
"auth": {
"mode": "token",
"token": "a-strong-random-token-here"
}
}
}
Remote Access
{
"gateway": {
"remote": {
"url": "wss://your-remote-host:3000",
"token": "YOUR_REMOTE_TOKEN"
}
}
}
Session Management
Read-Only Mode
Native Client Features
Message Delivery
{
"channels": {
"webchat": {
"textChunkLimit": 2000,
"blockStreaming": true
}
}
}
Security Best Practices
WebChat Configuration Reference
| Key | Type | Default | Description |
|---|---|---|---|
| gateway.port | number | 3000 | WebSocket port number for the Gateway |
| gateway.bind | string | "127.0.0.1" | Host address the Gateway binds to for WebSocket connections |
| gateway.auth.mode | string | "token" | Authentication mode: 'token' for shared secret or 'password' for credential-based auth |
| gateway.auth.token | string | "" | Shared secret token for WebSocket authentication |
| gateway.auth.password | string | "" | Password for WebSocket authentication |
| gateway.remote.url | string | "" | Remote Gateway WebSocket URL (e.g., wss://remote-host:3000) |
| gateway.remote.token | string | "" | Authentication token for connecting to a remote Gateway |
| gateway.remote.password | string | "" | Authentication password for connecting to a remote Gateway |
| session.defaultKey | string | "" | Default session key for WebChat conversations |
| session.storage | string | "memory" | Session storage backend (memory, file, redis, etc.) |
| textChunkLimit | number | 2000 | Maximum characters per outbound message chunk |
| blockStreaming | boolean | false | Send responses as block-based chunks during generation for real-time feedback |
WebSocket port number for the Gateway
Host address the Gateway binds to for WebSocket connections
Authentication mode: 'token' for shared secret or 'password' for credential-based auth
Shared secret token for WebSocket authentication
Password for WebSocket authentication
Remote Gateway WebSocket URL (e.g., wss://remote-host:3000)
Authentication token for connecting to a remote Gateway
Authentication password for connecting to a remote Gateway
Default session key for WebChat conversations
Session storage backend (memory, file, redis, etc.)
Maximum characters per outbound message chunk
Send responses as block-based chunks during generation for real-time feedback
WebChat Frequently Asked Questions
WebChat Troubleshooting
The Gateway is not running, or the WebSocket port is blocked by a firewall.
The token or password doesn't match the Gateway configuration.
The AI agent is not configured, or the AI provider API key is invalid.
The SSH tunnel is not forwarding the correct port, or the Gateway is not listening on the expected address.
The session expired or was cleared between connections.