Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
Use this page for day-1 startup and day-2 operations of the Gateway service.
Symptom-first diagnostics with exact command ladders and log signatures.
Task-oriented setup guide + full configuration reference.
SecretRef contract, runtime snapshot behavior, and migrate/reload operations.
Exact `secrets apply` target/path rules and ref-only auth-profile behavior.
textHealthy baseline: `Runtime: running`, `Connectivity probe: ok`, and `Capability: ...` that matches what you expect. Use `openclaw gateway status --require-rpc` when you need read-scope RPC proof, not just reachability.
textWith a reachable gateway this runs live per-account channel probes and optional audits. If the gateway is unreachable, the CLI falls back to config-only channel summaries instead of live probe output.
/v1/models/v1/embeddings/v1/chat/completions/v1/responses/tools/invokeloopbackgateway.auth.tokengateway.auth.passwordOPENCLAW_GATEWAY_TOKENOPENCLAW_GATEWAY_PASSWORDgateway.auth.mode: "trusted-proxy"OpenClaw’s highest-leverage compatibility surface is now:
GET /v1/modelsGET /v1/models/{id}POST /v1/embeddingsPOST /v1/chat/completionsPOST /v1/responsesWhy this set matters:
/v1/models/v1/embeddings/v1/responsesPlanning note:
/v1/modelsopenclawopenclaw/defaultopenclaw/<agentId>openclaw/defaultx-openclaw-modelAll of these run on the main Gateway port and use the same trusted operator auth boundary as the rest of the Gateway HTTP API.
| Setting | Resolution order |
|---|---|
| Gateway port | text --porttext OPENCLAW_GATEWAY_PORTtext gateway.porttext 18789 |
| Bind mode | CLI/override → text gateway.bindtext loopback |
Installed gateway services record the resolved
--portgateway.portopenclaw doctor --fixopenclaw gateway install --forceGateway startup uses the same effective port and bind when it seeds local Control UI origins for non-loopback binds. For example,
--bind lan --port 3000http://localhost:3000http://127.0.0.1:3000gateway.controlUi.allowedOriginstext gateway.reload.mode | Behavior |
|---|---|
text off | No config reload |
text hot | Apply only hot-safe changes |
text restart | Restart on reload-required changes |
text hybrid | Hot-apply when safe, restart when required |
bashopenclaw gateway status openclaw gateway status --deep # adds a system-level service scan openclaw gateway status --json openclaw gateway install openclaw gateway restart openclaw gateway stop openclaw secrets reload openclaw logs --follow openclaw doctor
gateway status --deepMost installs should run one gateway per machine. A single gateway can host multiple agents and channels.
You only need multiple gateways when you intentionally want isolation or a rescue bot.
Useful checks:
bashopenclaw gateway status --deep openclaw gateway probe
What to expect:
gateway status --deepOther gateway-like services detected (best effort)gateway probemultiple reachable gatewaysChecklist per instance:
gateway.portOPENCLAW_CONFIG_PATHOPENCLAW_STATE_DIRagents.defaults.workspaceExample:
bashOPENCLAW_CONFIG_PATH=~/.openclaw/a.json OPENCLAW_STATE_DIR=~/.openclaw-a openclaw gateway --port 19001 OPENCLAW_CONFIG_PATH=~/.openclaw/b.json OPENCLAW_STATE_DIR=~/.openclaw-b openclaw gateway --port 19002
Detailed setup: /gateway/multiple-gateways.
OpenClaw exposes a VoiceClaw-compatible real-time WebSocket endpoint at
/voiceclaw/realtimeThe endpoint uses Gemini Live for real-time audio and calls OpenClaw as the brain by exposing OpenClaw tools directly to Gemini Live. Tool calls return an immediate
workingGEMINI_API_KEYsession.configReal-time brain access runs owner-authorized OpenClaw agent commands. Keep
gateway.auth.mode: "none"For an isolated test gateway, run a separate instance with its own port, config, and state:
bashOPENCLAW_CONFIG_PATH=/path/to/openclaw-realtime/openclaw.json \ OPENCLAW_STATE_DIR=/path/to/openclaw-realtime/state \ OPENCLAW_SKIP_CHANNELS=1 \ GEMINI_API_KEY=... \ openclaw gateway --port 19789
Then configure VoiceClaw to use:
textws://127.0.0.1:19789/voiceclaw/realtime
Preferred: Tailscale/VPN. Fallback: SSH tunnel.
bashssh -N -L 18789:127.0.0.1:18789 user@host
Then connect clients locally to
ws://127.0.0.1:18789See: Remote Gateway, Authentication, Tailscale.
Use supervised runs for production-like reliability.
textUse `openclaw gateway restart` for restarts. Do not chain `openclaw gateway stop` and `openclaw gateway start`; on macOS, `gateway stop` intentionally disables the LaunchAgent before stopping it. LaunchAgent labels are `ai.openclaw.gateway` (default) or `ai.openclaw.<profile>` (named profile). `openclaw doctor` audits and repairs service config drift.
textFor persistence after logout, enable lingering: ```bash} sudo loginctl enable-linger <user> ``` Manual user-unit example when you need a custom install path: ```ini} [Unit] Description=OpenClaw Gateway After=network-online.target Wants=network-online.target [Service] ExecStart=/usr/local/bin/openclaw gateway --port 18789 Restart=always RestartSec=5 TimeoutStopSec=30 TimeoutStartSec=30 SuccessExitStatus=0 143 KillMode=control-group [Install] WantedBy=default.target ```
textNative Windows managed startup uses a Scheduled Task named `OpenClaw Gateway` (or `OpenClaw Gateway (<profile>)` for named profiles). If Scheduled Task creation is denied, OpenClaw falls back to a per-user Startup-folder launcher that points at `gateway.cmd` inside the state directory.
text```bash} sudo systemctl daemon-reload sudo systemctl enable --now openclaw-gateway[-<profile>].service ``` Use the same service body as the user unit, but install it under `/etc/systemd/system/openclaw-gateway[-<profile>].service` and adjust `ExecStart=` if your `openclaw` binary lives elsewhere. Do not also let `openclaw doctor --fix` install a user-level gateway service for the same profile/port. Doctor refuses that automatic install when it finds a system-level OpenClaw gateway service; use `OPENCLAW_SERVICE_REPAIR_POLICY=external` when the system unit owns the lifecycle.
bashopenclaw --dev setup openclaw --dev gateway --allow-unconfigured openclaw --dev status
Defaults include isolated state/config and base gateway port
19001connecthello-okpresencehealthstateVersionuptimeMshello-ok.features.methodseventsreq(method, params)res(ok/payload|error)connect.challengeagentchatsession.messagesession.toolsessions.changedpresencetickhealthheartbeatshutdownAgent runs are two-stage:
status:"accepted"status:"ok"|"error"agentSee full protocol docs: Gateway Protocol.
connecthello-okbashopenclaw gateway status openclaw channels status --probe openclaw health
Events are not replayed. On sequence gaps, refresh state (
healthsystem-presence| Signature | Likely issue |
|---|---|
text refusing to bind gateway ... without auth | Non-loopback bind without a valid gateway auth path |
text another gateway instance is already listeningtext EADDRINUSE | Port conflict |
text Gateway start blocked: set gateway.mode=local | Config set to remote mode, or local-mode stamp is missing from a damaged config |
text unauthorized | Auth mismatch between client and gateway |
For full diagnosis ladders, use Gateway Troubleshooting.
shutdownRelated:
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine