OpenClaw API

Developer documentation for integrating with OpenClaw.

What API Surface Exists?

OpenClaw exposes several interfaces:

  • CLI — Command-line interface for all operations
  • Gateway API — WebSocket + HTTP for agent communication
  • Control UI — Web dashboard at port 18789
  • Skills — Extend functionality with custom tools

CLI vs API vs UI vs Skills

InterfaceBest For
CLIScripting, automation, local use
Gateway APIBuilding custom clients, integrations
Control UIManual configuration, monitoring
SkillsExtending agent capabilities

Gateway API

The Gateway API is the primary integration point. It exposes:

  • WebSocket — Real-time agent communication
  • HTTP REST — Configuration, status, management
  • Port — 18789 by default
# Connect to gateway
ws://127.0.0.1:18789

# REST endpoints
http://127.0.0.1:18789/api/status
http://127.0.0.1:18789/api/config
http://127.0.0.1:18789/api/agents

Authentication

Configure token-based auth in your config:

// openclaw.json
{
  "gateway": {
    "token": "your-secure-token",
    "requireAuth": true
  }
}

Common Use Cases

Custom Clients

Build your own chat interface using the Gateway API.

Webhook Integrations

Trigger actions from external services.

CRM Integration

Connect agents to your customer data.

Monitoring

Pull metrics into your dashboards.

Security Considerations

  • • Always use a strong token in production
  • • Bind gateway to localhost when possible
  • • Use TLS/SSL for remote access
  • • Implement rate limiting
  • • Follow principle of least privilege

Next Steps