Gateway
Gateway protocol system and channel methods
RPC method families for gateway status and identity, models and usage, channels and login, plugin management, messaging and logs, and the operator terminal.
System and identity
healthreturns the cached or freshly probed gateway health snapshot.diagnostics.stabilityreturns the recent bounded diagnostic stability recorder: event names, counts, byte sizes, memory readings, queue/session state, channel/plugin names, session ids. No chat text, webhook bodies, tool outputs, raw request/response bodies, tokens, cookies, or secrets. Requiresoperator.read.statusreturns the/status-style gateway summary; sensitive fields only for admin-scoped operator clients.gateway.identity.getreturns the gateway device identity used by relay and pairing flows.system-presencereturns the current presence snapshot for connected operator/node devices.system-eventappends a system event and can update/broadcast presence context.last-heartbeatreturns the latest persisted heartbeat event.set-heartbeatstoggles heartbeat processing on the gateway.gateway.restart.preflightis a deprecated, read-only compatibility preview of restart-specific active work. It does not close admission, create a suspension lease, or provide the atomic full-work fence ofgateway.suspend.prepare; new restart flows should callgateway.restart.request.gateway.suspend.preparecreates a short cooperative-suspension lease only when tracked Gateway work is idle. While prepared, authenticated WebSocket connects remain available, but onlygateway.suspend.*and an exact targeted non-safegateway.restart.requestmay run; safe and untargeted restarts remain fenced.gateway.suspend.statuschecks the lease, andgateway.suspend.resumereleases it after thaw or an aborted host operation.
Models and usage
models.listreturns the runtime-allowed model catalog. Seemodels.listviews.usage.statusreturns provider usage windows/remaining quota summaries. Clients advertisingusage-refreshingreceive an immediaterefreshing: trueplaceholder on a cold cache and must refetch on a bounded schedule; other callers block for the cold provider read.usage.costreturns aggregated cost usage summaries for a date range. PassagentIdfor one agent, oragentScope: "all"to aggregate configured agents.doctor.memory.statusreturns vector-memory / cached embedding readiness for the active default agent workspace. Pass{ "probe": true }or{ "deep": true }only for an explicit live embedding provider ping. Pass{ "agentId": "agent-id" }to scope Dreaming store stats to one agent workspace; omitting it aggregates configured Dreaming workspaces.doctor.memory.dreamDiary,doctor.memory.backfillDreamDiary,doctor.memory.resetDreamDiary,doctor.memory.resetGroundedShortTerm,doctor.memory.repairDreamingArtifacts, anddoctor.memory.dedupeDreamDiaryaccept optional{ "agentId": "agent-id" }; omitted, they operate on the configured default agent workspace.sessions.usagereturns per-session usage summaries. PassagentIdfor one agent, oragentScope: "all"to list configured agents together. Both usage methods acceptmode: "specific"with an IANAtimeZonefor DST-aware calendar-day boundaries and buckets.utcOffsetremains supported for older clients and as a fallback when the Gateway runtime does not recognize the requested zone.sessions.usage.timeseriesreturns timeseries usage for one session.sessions.usage.logsreturns usage log entries for one session. Both detail methods accept the selected row'skeyand optionalagentId. Preserve both fields when opening details for an unqualified key such asglobal.
Channels and login helpers
channels.statusreturns built-in + bundled channel/plugin status summaries.channels.start(operator.admin) starts one channel account runtime without re-authenticating. Params{ channel, accountId? }; omittedaccountIdselects the default account. Responds{ channel, accountId, started, outcome }, withstartedtrue only when the resulting runtime snapshot reportsrunning: true.outcomecarries the account lifecycle decision:{ status: "handed-off" },{ status: "retry", reason }, or{ status: "skipped", reason }. The RPC is a manual override of automatic-start suppression; nomanualparameter is accepted. This is not a provider-connectivity check; see Per-account recovery for reasons and recovery guidance.channels.stop(operator.admin) stops one channel account runtime without clearing auth state. Params{ channel, accountId? }; omittedaccountIdselects the default account. Responds{ channel, accountId, stopped }, withstoppedtrue when the resulting runtime snapshot does not reportrunning: true. Unlikechannels.logout, it retains the account's credentials.channels.logoutlogs out a specific channel/account where the channel supports it.web.login.startstarts a QR/web login flow. Params include optional{ channel, accountId, force, timeoutMs, verbose }. Whenchannelis present, the Gateway normalizes its canonical id or alias and dispatches only to that installed channel plugin. Omittingchannelpreserves the legacy behavior of selecting the first loaded QR-capable provider. A provider may return an opaquesessionKeywith its QR response.web.login.waitwaits for that flow to complete and starts the channel on success. Params include optional{ channel, accountId, sessionKey, timeoutMs, currentQrDataUrl }. Use the samechannelasweb.login.startand pass its returnedsessionKeythrough unchanged so the provider can correlate the wait request with the QR session. Omittingchannelretains the same legacy provider fallback asweb.login.start.push.testsends a test APNs push to a registered iOS node.voicewake.getreturns the stored wake-word triggers.voicewake.setupdates wake-word triggers and broadcasts the change.
Plugin management
plugins.list(operator.read) returns the installed plugin inventory plus locally curated official picks, diagnostics, and whether the current install mode allows mutations.plugins.search(operator.read) searches installable ClawHub code-plugin and bundle-plugin families. Pass non-emptyqueryand optionallimitfrom 1 to 100.plugins.install(operator.admin) installs either an official catalog entry with{ source: "official", pluginId, acknowledgeInstallPolicyWarning? }or a ClawHub package with{ source: "clawhub", packageName, version?, acknowledgeInstallPolicyWarning? }. When install policy returnswarn, the errordetailsincludeinstallPolicyCode: "install_policy_warning_acknowledgement_required", the target, reason, and optional findings. After review, retrying the same action withacknowledgeInstallPolicyWarning: trueapproves every warning in that install invocation; each warning is freshly evaluated before installation continues.blockand policy failures remain terminal. ClawHub installs preserve Gateway trust and integrity checks. Successful installs require a Gateway restart.plugins.setEnabled(operator.admin) changes one installed plugin's enabled policy with{ pluginId, enabled }. The response includes the updated catalog entry, restart metadata, and any slot-selection warnings.plugins.uninstall(operator.admin) removes one externally installed plugin with{ pluginId }: config references, the install record, and managed files. Bundled plugins cannot be uninstalled, only disabled. The response lists the removal actions and always requires a Gateway restart.
Messaging and logs
sendis the direct outbound-delivery RPC for channel/account/thread-targeted sends outside the chat runner.logs.tailreturns the configured gateway file-log tail with cursor/limit and max-byte controls.
Operator terminal
terminal.openstarts a host PTY for an explicitagentIdor the default agent and returns the resolved agent, working directory, shell, and confinement state. PassingsessionKeybinds the PTY to that exact agent session and attaches the calling connection as its first viewer; omitting it creates a connection-owned operator terminal.terminal.inputandterminal.resizeoperate on sessions owned by the calling connection and agent-owned sessions where that connection is an attached viewer.terminal.closekills a connection-owned session, but only detaches the calling viewer from an established agent-owned session. For a new session-bound Control UI terminal, the initiating viewer's close or disconnect discards the PTY until the browser or exact-session agent first adopts it through an authorized operation.terminal.uploadaccepts one base64 file up to 16 MiB, stages it in a private 24-hour temporary directory on the session's Gateway or paired-node host, and returns the absolute path. The caller must still paste or otherwise use that path; the RPC never writes terminal input or executes a command.terminal.dataandterminal.exitevents stream to the connection owner and attached viewers. Conversation-owned terminals remain persistent. The agent-facingterminaltool can list, read, resize, or close only terminals an operator opened for its exact session; it cannot open terminals. Agent input follows effective session and exec policy:full(YOLO) sends immediately,guardedandworkspace(including accept-only or Guardian-reviewed flows) require explicit one-time approval of that exact input, andread-onlyordenyblocks it.- Connection-owned sessions whose connection drops are detached, not killed: they stay reattachable for
gateway.terminal.detachedSessionTimeoutSeconds(default 300;0restores kill-on-disconnect) while recent output accumulates in a bounded server-side buffer. Established agent-owned sessions likewise survive viewer disconnect. terminal.listreturns attachable sessions.terminal.attachreturns the replay buffer and either rebinds a connection-owned session (tmux-style take-over — a previous live owner receivesterminal.exitwith reasondetached) or adds the connection as a viewer of an agent-owned session.- Every terminal method requires
operator.admin;gateway.terminal.enabledis on by default and refuses every method when set tofalse. Fully sandboxed agents are refused, and an agent policy change closes existing and in-flight PTYs, detached ones included.
Was this useful?