Skip to main content

Overview

The orcbot 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:
Response:

POST /api/tasks

Push a new task to the action queue. Request:
Response:

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:
Response:

GET /api/memory

Retrieve recent memories. Query params:
  • type: Filter by type (short, episodic, long)
  • limit: Max results (default: 50)
  • search: Keyword search
Response:

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)
Response:

GET /api/security

View security settings. Response:

PUT /api/security

Update security settings. Request:
Response:

WebSocket Interface

Connect to ws://host:port for real-time events.

Connection

Events

status - Initial agent status after connection:
event - Agent lifecycle events:
action - Skill execution:
observation - Skill results:

Client Actions

Send commands to the gateway via WebSocket: pushTask:
executeSkill:
getStatus:
setConfig:

Authentication

When --api-key is set or gatewayApiKey is configured, all requests require authentication.

REST API

Include X-Api-Key header:

WebSocket

Send API key in connection query string:
Unauthorized response (401):

Background Mode

Run gateway as a background process:
Output:
View logs:

Examples

Basic Gateway

Output:

Gateway with Agent Loop

Starts both gateway and agent loop in same process. Useful for single-command deployment.

Localhost-Only Gateway

Only accessible from the same machine. More secure for local development.

Gateway with Dashboard

Serves static dashboard files at http://localhost:3100/.

Remote Access with Tailscale

Security Best Practices

Never Expose Gateway Publicly Without API KeyIf binding to 0.0.0.0, always set an API key:
Otherwise, anyone can control your agent remotely.
Recommended: Use Tailscale for Remote AccessInstead of exposing port 3100 to the internet:
  1. Install Tailscale on server and client
  2. Connect both to same Tailnet
  3. Bind gateway to 0.0.0.0 (or Tailscale IP)
  4. Set API key for defense-in-depth
  5. Use Tailnet ACLs to restrict access
Access via Tailscale IP (100.x.x.x) from any authorized device.

HTTPS/TLS

The gateway does not natively support HTTPS. Use a reverse proxy:

Configuration

Gateway settings in orcbot.config.yaml:

Troubleshooting

Port Already in Use

Cannot Connect to WebSocket

401 Unauthorized

Gateway Not Starting with β€”with-agent

  • 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