Overview
Theorcbot gateway command starts an Express-based web server that exposes OrcBotβs capabilities via REST API and WebSocket connections. It provides remote management, task queuing, and real-time event streaming.
Usage
Options
number
default:"3100"
Port to listen on. Must be available and not used by another process.
string
default:"0.0.0.0"
Host/interface to bind to. Use
127.0.0.1 for localhost-only, 0.0.0.0 for all interfaces.string
API key for authentication. If set, all API requests must include
X-Api-Key header. Overrides gatewayApiKey config value.string
Path to static files for web dashboard. Serves files at root
/. Useful for hosting a custom frontend.boolean
default:"false"
Also start the agent autonomous loop alongside the gateway. Allows full remote operation without separate
orcbot run command.boolean
default:"false"
Run gateway in background (detached process). Logs to
~/.orcbot/gateway.log. Stop with pkill -f "orcbot gateway --background-child".REST API Endpoints
All endpoints are prefixed with/api.
GET /api/status
Returns agent status and system information. Response:GET /api/skills
List all available skills with metadata. Response:POST /api/skills/:name/execute
Execute a specific skill with parameters. Request:POST /api/tasks
Push a new task to the action queue. Request:GET /api/tasks
View current task queue. Response:GET /api/config
View current configuration (sensitive values redacted). Response:PUT /api/config/:key
Update a configuration value. Request:GET /api/memory
Retrieve recent memories. Query params:type: Filter by type (short,episodic,long)limit: Max results (default: 50)search: Keyword search
GET /api/connections
View channel connection status. Response:GET /api/logs
Retrieve recent log entries. Query params:level: Filter by level (info,warn,error)limit: Max entries (default: 100)
GET /api/security
View security settings. Response:PUT /api/security
Update security settings. Request:WebSocket Interface
Connect tows://host:port for real-time events.
Connection
Events
status - Initial agent status after connection:Client Actions
Send commands to the gateway via WebSocket: pushTask:Authentication
When--api-key is set or gatewayApiKey is configured, all requests require authentication.
REST API
IncludeX-Api-Key header:
WebSocket
Send API key in connection query string:Background Mode
Run gateway as a background process:Examples
Basic Gateway
Gateway with Agent Loop
Localhost-Only Gateway
Gateway with Dashboard
http://localhost:3100/.
Remote Access with Tailscale
Security Best Practices
Recommended: Use Tailscale for Remote AccessInstead of exposing port 3100 to the internet:
- Install Tailscale on server and client
- Connect both to same Tailnet
- Bind gateway to
0.0.0.0(or Tailscale IP) - Set API key for defense-in-depth
- Use Tailnet ACLs to restrict access
HTTPS/TLS
The gateway does not natively support HTTPS. Use a reverse proxy:Configuration
Gateway settings inorcbot.config.yaml:
Troubleshooting
Port Already in Use
Cannot Connect to WebSocket
401 Unauthorized
Gateway Not Starting with βwith-agent
Related Commands
orcbot run- Start agent (can auto-start gateway with--with-gateway)orcbot push- Queue tasks (also available via gateway API)orcbot ui- TUI management (alternative to gateway)orcbot stop- Stop all processes including background gateway
See Also
- Gateway Server Implementation - Source code
- WebSocket Client Examples - Integration guides
- Tailscale Setup Guide - Private networking