OpenClaw operations
This client mirrors and verifies upstream-compatible behavior. Upstream runtimes remain the canonical protocol owners.
Gateway provider. OpenClawApiClient extends GatewayApiClient, which implements the universal RuntimeClient over the gateway surface openclaw-api (provider kind openclaw, alias open-claw). Each unified call is dispatched to OpenClaw's native RPC surface (e.g. chat.send / agent.wait) rather than plain REST route literals, so no provider-owned paths.ts exists — the HTTP lines below read gateway RPC. Streaming is delivered through a RunEventStreamProvider (subscribe-by-runId), not an inline streamRun. The batch surface is not supported.
Capability (from GatewayApiClient.getRuntimeCapabilities()): runs ✅ · getRun ✅ · cancelRun ✅ · streamRun ✅ (via provider) · batch ❌.
startRun
Dispatches a run to OpenClaw's native surface and normalizes the status to the universal RuntimeRunStatus. See runtime · startRun for the full field tables.
Example
import { OPENCLAW_PROVIDER_MODULE } from "@cavi-ai/api-client/providers/openclaw";
// … construct the gateway client via the provider module, then:
const run = await client.startRun({ input: "Hi", model: "…" });getRun
Reads run status by id over gateway RPC. Field tables per runtime · getRun.
cancelRun
Stops a run over gateway RPC. See runtime · cancelRun.
streamRun
The low-level OpenClawApiClient omits an inline streamRun; run events arrive over the shared socket as native chat/agent frames keyed by runId. The createApiClient facade bridges those frames into streamRun, which resolves a CapabilityResult<RunStreamOutcome>. A caller abort resolves ok:false with a request-aborted gap and a best-effort cancelRun. See runtime · streamRun.
Headless connect
Origin-gated gateways reject a client that sends no Origin and clear device-less operator scopes. Pass clientOrigin, clientMode: "cli", and requestedScopes on createApiClient to present an allowlisted origin and retain operator scopes over shared-secret auth.
agentConfig.listProfiles
Lists agent profiles over agents.list, normalized to AgentProfileSummary[]. Other agent-config methods remain gated pending shape verification.
teams
Not an RPC. client.teams.* resolves from the provider manifest: when no explicit teams backend is supplied, the facade builds a TeamDirectory from the resolved manifest via teamDirectoryFromManifest. Absent a manifest, teams.* returns a gap.
Batch
Not supported — supports.batch is absent; the batch methods are not implemented on the gateway client.
Control-plane adapter
OpenClaw declares all seven canonical modules and its stable WebSocket transport; unregistered providers retain the required shape and typed unavailable errors. The six focused clients are sessions, models, usage, tasks, workspace, and authentication status; RuntimeEventClient is the event subscription contract, and RuntimeTransportCapabilities declares the available transports separately. RuntimeControlPlane remains the optional declaration-driven contract, and RuntimeAuthStatus is the read-only, secret-safe model-availability and authentication-status shape. The verified facade and its per-module methods are documented under gateway control-plane operations.