TaskFlow
DashboardFreewriteWhiteboardsProjectsCRMTasksNotificationsSettingsAgent TowerAPI Docs
OpenClaw Docs
?

User

Member

Caricamento in corso...

Home
Progetti
Task
Notifiche
CRM

    OpenClaw

    Documentation Mirror

    Documentation Overview

    Docs

    Auth credential semantics
    Scheduled tasks
    Hooks
    Automation & tasks
    Standing orders
    Task flow
    Background tasks
    BlueBubbles
    Broadcast groups
    Channel routing
    Discord
    Feishu
    Google Chat
    Group messages
    Groups
    iMessage
    Chat channels
    IRC
    LINE
    Channel location parsing
    Matrix
    Matrix migration
    Matrix push rules for quiet previews
    Mattermost
    Microsoft Teams
    Nextcloud Talk
    Nostr
    Pairing
    QA channel
    QQ bot
    Signal
    Slack
    Synology Chat
    Telegram
    Tlon
    Channel troubleshooting
    Twitch
    WeChat
    WhatsApp
    Yuanbao
    Zalo
    Zalo personal
    CI pipeline
    ACP
    Agent
    Agents
    Approvals
    Backup
    Browser
    Channels
    Clawbot
    `openclaw commitments`
    Completion
    Config
    Configure
    Cron
    Daemon
    Dashboard
    Devices
    Directory
    DNS
    Docs
    Doctor
    Flows (redirect)
    Gateway
    Health
    Hooks
    CLI reference
    Inference CLI
    Logs
    MCP
    Memory
    Message
    Migrate
    Models
    Node
    Nodes
    Onboard
    Pairing
    Plugins
    Proxy
    QR
    Reset
    Sandbox CLI
    Secrets
    Security
    Sessions
    Setup
    Skills
    Status
    System
    `openclaw tasks`
    TUI
    Uninstall
    Update
    Voicecall
    Webhooks
    Wiki
    Active memory
    Agent runtime
    Agent loop
    Agent runtimes
    Agent workspace
    Gateway architecture
    Channel docking
    Inferred commitments
    Compaction
    Context
    Context engine
    Delegate architecture
    Dreaming
    Experimental features
    Features
    Markdown formatting
    Memory overview
    Builtin memory engine
    Honcho memory
    QMD memory engine
    Memory search
    Messages
    Model failover
    Model providers
    Models CLI
    Multi-agent routing
    OAuth
    OpenClaw App SDK
    Presence
    QA overview
    Matrix QA
    Command queue
    Steering queue
    Retry policy
    Session management
    Session pruning
    Session tools
    SOUL.md personality guide
    Streaming and chunking
    System prompt
    Timezones
    TypeBox
    Typing indicators
    Usage tracking
    Date and time
    Node + tsx crash
    Diagnostics flags
    Authentication
    Background exec and process tool
    Bonjour discovery
    Bridge protocol
    CLI backends
    Configuration — agents
    Configuration — channels
    Configuration — tools and custom providers
    Configuration
    Configuration examples
    Configuration reference
    Diagnostics export
    Discovery and transports
    Doctor
    Gateway lock
    Health checks
    Heartbeat
    Gateway runbook
    Local models
    Gateway logging
    Multiple gateways
    Network model
    OpenAI chat completions
    OpenResponses API
    OpenShell
    OpenTelemetry export
    Gateway-owned pairing
    Prometheus metrics
    Gateway protocol
    Remote access
    Remote gateway setup
    Sandbox vs tool policy vs elevated
    Sandboxing
    Secrets management
    Secrets apply plan contract
    Security audit checks
    Security
    Tailscale
    Tools invoke API
    Troubleshooting
    Trusted proxy auth
    Debugging
    Environment variables
    FAQ
    FAQ: first-run setup
    FAQ: models and auth
    GPT-5.5 / Codex agentic parity
    GPT-5.5 / Codex parity maintainer notes
    Help
    Scripts
    Testing
    Testing: live suites
    General troubleshooting
    OpenClaw
    Ansible
    Azure
    Bun (experimental)
    ClawDock
    Release channels
    DigitalOcean
    Docker
    Docker VM runtime
    exe.dev
    Fly.io
    GCP
    Hetzner
    Hostinger
    Install
    Installer internals
    Kubernetes
    macOS VMs
    Migration guide
    Migrating from Claude
    Migrating from Hermes
    Nix
    Node.js
    Northflank
    Oracle Cloud
    Podman
    Railway
    Raspberry Pi
    Render
    Uninstall
    Updating
    Logging
    Network
    Audio and voice notes
    Camera capture
    Image and media support
    Nodes
    Location command
    Media understanding
    Talk mode
    Node troubleshooting
    Voice wake
    Pi integration architecture
    Pi development workflow
    Android app
    Platforms
    iOS app
    Linux app
    Gateway on macOS
    Canvas
    Gateway lifecycle
    macOS dev setup
    Health checks (macOS)
    Menu bar icon
    macOS logging
    Menu bar
    Peekaboo bridge
    macOS permissions
    Remote control
    macOS signing
    Skills (macOS)
    Voice overlay
    Voice wake (macOS)
    WebChat (macOS)
    macOS IPC
    macOS app
    Windows
    Plugin internals
    Plugin architecture internals
    Building plugins
    Plugin bundles
    Codex Computer Use
    Codex harness
    Community plugins
    Plugin compatibility
    Google Meet plugin
    Plugin hooks
    Plugin manifest
    Memory LanceDB
    Memory wiki
    Message presentation
    Agent harness plugins
    Building channel plugins
    Channel turn kernel
    Plugin entry points
    Plugin SDK migration
    Plugin SDK overview
    Building provider plugins
    Plugin runtime helpers
    Plugin setup and config
    Plugin SDK subpaths
    Plugin testing
    Skill workshop plugin
    Voice call plugin
    Webhooks plugin
    Zalo personal plugin
    OpenProse
    Alibaba Model Studio
    Anthropic
    Arcee AI
    Azure Speech
    Amazon Bedrock
    Amazon Bedrock Mantle
    Chutes
    Claude Max API proxy
    Cloudflare AI gateway
    ComfyUI
    Deepgram
    Deepinfra
    DeepSeek
    ElevenLabs
    Fal
    Fireworks
    GitHub Copilot
    GLM (Zhipu)
    Google (Gemini)
    Gradium
    Groq
    Hugging Face (inference)
    Provider directory
    Inferrs
    Inworld
    Kilocode
    LiteLLM
    LM Studio
    MiniMax
    Mistral
    Model provider quickstart
    Moonshot AI
    NVIDIA
    Ollama
    OpenAI
    OpenCode
    OpenCode Go
    OpenRouter
    Perplexity
    Qianfan
    Qwen
    Runway
    SGLang
    StepFun
    Synthetic
    Tencent Cloud (TokenHub)
    Together AI
    Venice AI
    Vercel AI gateway
    vLLM
    Volcengine (Doubao)
    Vydra
    xAI
    Xiaomi MiMo
    Z.AI
    Default AGENTS.md
    Release policy
    API usage and costs
    Credits
    Device model database
    Full release validation
    Memory configuration reference
    OpenClaw App SDK API design
    Prompt caching
    Rich output protocol
    RPC adapters
    SecretRef credential surface
    Session management deep dive
    AGENTS.md template
    BOOT.md template
    BOOTSTRAP.md template
    HEARTBEAT.md template
    IDENTITY template
    SOUL.md template
    TOOLS.md template
    USER template
    Tests
    Token use and costs
    Transcript hygiene
    Onboarding reference
    Contributing to the threat model
    Threat model (MITRE ATLAS)
    Formal verification (security models)
    Network proxy
    Agent bootstrapping
    Docs directory
    Getting started
    Docs hubs
    OpenClaw lore
    Onboarding (macOS app)
    Onboarding overview
    Personal assistant setup
    Setup
    Showcase
    Onboarding (CLI)
    CLI automation
    CLI setup reference
    ACP agents
    ACP agents — setup
    Agent send
    apply_patch tool
    Brave search
    Browser (OpenClaw-managed)
    Browser control API
    Browser troubleshooting
    Browser login
    WSL2 + Windows + remote Chrome CDP troubleshooting
    BTW side questions
    ClawHub
    Code execution
    Creating skills
    Diffs
    DuckDuckGo search
    Elevated mode
    Exa search
    Exec tool
    Exec approvals
    Exec approvals — advanced
    Firecrawl
    Gemini search
    Grok search
    Image generation
    Tools and plugins
    Kimi search
    LLM task
    Lobster
    Tool-loop detection
    Media overview
    MiniMax search
    Multi-agent sandbox and tools
    Music generation
    Ollama web search
    PDF tool
    Perplexity search
    Plugins
    Reactions
    SearXNG search
    Skills
    Skills config
    Slash commands
    Sub-agents
    Tavily
    Thinking levels
    Tokenjuice
    Trajectory bundles
    Text-to-speech
    Video generation
    Web search
    Web fetch
    Linux server
    Control UI
    Dashboard
    Web
    TUI
    WebChat

    OpenAPI Specs

    openapi
    TaskFlow
    docs/openclaw
    Original Docs

    Real-time Synchronized Documentation

    Last sync: 01/05/2026 07:05:25

    Note: This content is mirrored from docs.openclaw.ai and is subject to their terms and conditions.

    OpenClaw Docs

    v2.4.0 Production

    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.

    OpenClaw App SDK

    The OpenClaw App SDK is the public client API for apps outside the OpenClaw process. Use

    text
    @openclaw/sdk
    when a script, dashboard, CI job, IDE extension, or other external app wants to connect to the Gateway, start agent runs, stream events, wait for results, cancel work, or inspect Gateway resources.

    note

    The App SDK is different from the [Plugin SDK](/plugins/sdk-overview). `@openclaw/sdk` talks to the Gateway from outside OpenClaw. `openclaw/plugin-sdk/*` is only for plugins that run inside OpenClaw and register providers, channels, tools, hooks, or trusted runtimes.

    What Ships Today

    text
    @openclaw/sdk
    ships with:

    SurfaceStatusWhat it does
    text
    OpenClaw
    ReadyMain client entry point. Owns transport, connection, requests, and events.
    text
    GatewayClientTransport
    ReadyWebSocket transport backed by the Gateway client.
    text
    oc.agents
    ReadyLists, creates, updates, deletes, and gets agent handles.
    text
    Agent.run()
    ReadyStarts a Gateway
    text
    agent
    run and returns a
    text
    Run
    .
    text
    oc.runs
    ReadyCreates, gets, waits for, cancels, and streams runs.
    text
    Run.events()
    ReadyStreams normalized per-run events with replay for fast runs.
    text
    Run.wait()
    ReadyCalls
    text
    agent.wait
    and returns a stable
    text
    RunResult
    .
    text
    Run.cancel()
    ReadyCalls
    text
    sessions.abort
    by run id, with session key when available.
    text
    oc.sessions
    ReadyCreates, resolves, sends to, patches, compacts, and gets session handles.
    text
    Session.send()
    ReadyCalls
    text
    sessions.send
    and returns a
    text
    Run
    .
    text
    oc.models
    ReadyCalls
    text
    models.list
    and the current
    text
    models.authStatus
    status RPC.
    text
    oc.tools
    PartialLists tool catalog and effective tools; direct tool invocation is not wired.
    text
    oc.artifacts
    ReadyLists, gets, and downloads Gateway transcript artifacts.
    text
    oc.approvals
    ReadyLists and resolves exec approvals through Gateway approval RPCs.
    text
    oc.rawEvents()
    ReadyExposes raw Gateway events for advanced consumers.
    text
    normalizeGatewayEvent()
    ReadyConverts raw Gateway events into the stable SDK event shape.

    The SDK also exports the core types used by those surfaces:

    text
    AgentRunParams
    ,
    text
    RunResult
    ,
    text
    RunStatus
    ,
    text
    OpenClawEvent
    ,
    text
    OpenClawEventType
    ,
    text
    GatewayEvent
    ,
    text
    OpenClawTransport
    ,
    text
    GatewayRequestOptions
    ,
    text
    SessionCreateParams
    ,
    text
    SessionSendParams
    ,
    text
    ArtifactSummary
    ,
    text
    ArtifactQuery
    ,
    text
    ArtifactsListResult
    ,
    text
    ArtifactsGetResult
    ,
    text
    ArtifactsDownloadResult
    ,
    text
    RuntimeSelection
    ,
    text
    EnvironmentSelection
    ,
    text
    WorkspaceSelection
    ,
    text
    ApprovalMode
    , and related result types.

    Connect To A Gateway

    Create a client with an explicit Gateway URL, or inject a custom transport for tests and embedded app runtimes.

    typescript
    import { OpenClaw } from "@openclaw/sdk"; const oc = new OpenClaw({ url: "ws://127.0.0.1:14565", token: process.env.OPENCLAW_GATEWAY_TOKEN, requestTimeoutMs: 30_000, }); await oc.connect();

    text
    new OpenClaw({ gateway: "ws://..." })
    is equivalent to
    text
    url
    . The
    text
    gateway: "auto"
    option is accepted by the constructor, but automatic Gateway discovery is not a separate SDK feature yet; pass
    text
    url
    when the app does not already know how to discover the Gateway.

    For tests, pass an object that implements

    text
    OpenClawTransport
    :

    typescript
    const oc = new OpenClaw({ transport: { async request(method, params) { return { method, params }; }, async *events() {}, }, });

    Run An Agent

    Use

    text
    oc.agents.get(id)
    when the app wants an agent handle, then call
    text
    agent.run()
    .

    typescript
    const agent = await oc.agents.get("main"); const run = await agent.run({ input: "Review this pull request and suggest the smallest safe fix.", model: "openai/gpt-5.5", sessionKey: "main", timeoutMs: 30_000, }); for await (const event of run.events()) { const data = event.data as { delta?: unknown }; if (event.type === "assistant.delta" && typeof data.delta === "string") { process.stdout.write(data.delta); } } const result = await run.wait({ timeoutMs: 120_000 }); console.log(result.status);

    Provider-qualified model refs such as

    text
    openai/gpt-5.5
    are split into Gateway
    text
    provider
    and
    text
    model
    overrides.
    text
    timeoutMs
    stays milliseconds in the SDK and is converted to Gateway timeout seconds for the
    text
    agent
    RPC.

    text
    run.wait()
    uses the Gateway
    text
    agent.wait
    RPC. A wait deadline that expires while the run is still active returns
    text
    status: "accepted"
    instead of pretending the run itself timed out. Runtime timeouts, aborted runs, and cancelled runs are normalized into
    text
    timed_out
    or
    text
    cancelled
    .

    Create And Reuse Sessions

    Use sessions when the app wants durable transcript state.

    typescript
    const session = await oc.sessions.create({ agentId: "main", label: "release-review", }); const run = await session.send("Prepare release notes from the current diff."); await run.wait();

    text
    Session.send()
    calls
    text
    sessions.send
    and returns a
    text
    Run
    . Session handles also support:

    typescript
    await session.abort(run.id); await session.patch({ label: "renamed-session" }); await session.compact({ maxLines: 200 });

    Stream Events

    The SDK normalizes raw Gateway events into a stable

    text
    OpenClawEvent
    envelope:

    typescript
    type OpenClawEvent = { version: 1; id: string; ts: number; type: OpenClawEventType; runId?: string; sessionId?: string; sessionKey?: string; taskId?: string; agentId?: string; data: unknown; raw?: GatewayEvent; };

    Common event types include:

    Event typeSource Gateway event
    text
    run.started
    text
    agent
    lifecycle start
    text
    run.completed
    text
    agent
    lifecycle end
    text
    run.failed
    text
    agent
    lifecycle error
    text
    run.cancelled
    Aborted/cancelled lifecycle end
    text
    run.timed_out
    Timeout lifecycle end
    text
    assistant.delta
    Assistant streaming delta
    text
    assistant.message
    Assistant message
    text
    thinking.delta
    Thinking or plan stream
    text
    tool.call.started
    Tool/item/command start
    text
    tool.call.delta
    Tool/item/command update
    text
    tool.call.completed
    Tool/item/command completion
    text
    tool.call.failed
    Tool/item/command failure or blocked status
    text
    approval.requested
    Exec or plugin approval request
    text
    approval.resolved
    Exec or plugin approval resolution
    text
    session.created
    text
    sessions.changed
    create
    text
    session.updated
    text
    sessions.changed
    update
    text
    session.compacted
    text
    sessions.changed
    compaction
    text
    task.updated
    Task update events
    text
    artifact.updated
    Patch stream events
    text
    raw
    Any event without a stable SDK mapping yet

    text
    Run.events()
    filters events to one run id and replays already-seen events for fast runs. That means the documented flow is safe:

    typescript
    const run = await agent.run("Summarize the latest session."); for await (const event of run.events()) { if (event.type === "run.completed") { break; } }

    For app-wide streams, use

    text
    oc.events()
    . For raw Gateway frames, use
    text
    oc.rawEvents()
    .

    Models, Tools, Artifacts, And Approvals

    Model helpers map to current Gateway methods:

    typescript
    await oc.models.list(); await oc.models.status({ probe: false }); // calls models.authStatus

    Tool helpers expose the Gateway catalog and effective tool view:

    typescript
    await oc.tools.list(); await oc.tools.effective({ sessionKey: "main" });

    Artifact helpers expose the Gateway artifact projection for session, run, or task context. Each call requires one explicit

    text
    sessionKey
    ,
    text
    runId
    , or
    text
    taskId
    scope:

    typescript
    const { artifacts } = await oc.artifacts.list({ sessionKey: "main" }); const first = artifacts[0]; if (first) { const { artifact } = await oc.artifacts.get(first.id, { sessionKey: "main" }); const download = await oc.artifacts.download(artifact.id, { sessionKey: "main" }); console.log(download.encoding, download.url); }

    Approval helpers use the exec approval RPCs:

    typescript
    const approvals = await oc.approvals.list(); await oc.approvals.respond("approval-id", { decision: "approve" });

    Explicitly Unsupported Today

    The SDK includes names for the product model we want, but it does not silently pretend Gateway RPCs exist. These calls currently throw explicit unsupported errors:

    typescript
    await oc.tasks.list(); await oc.tasks.get("task-id"); await oc.tasks.cancel("task-id"); await oc.tools.invoke("tool-name", {}); await oc.environments.list(); await oc.environments.create({}); await oc.environments.status("environment-id"); await oc.environments.delete("environment-id");

    Per-run

    text
    workspace
    ,
    text
    runtime
    ,
    text
    environment
    , and
    text
    approvals
    fields are typed as future shape, but the current Gateway does not support those overrides on the
    text
    agent
    RPC. If callers pass them, the SDK throws before submitting the run so work does not accidentally execute with default workspace, runtime, environment, or approval behavior.

    App SDK Versus Plugin SDK

    Use the App SDK when code lives outside OpenClaw:

    • Node scripts that start or observe agent runs
    • CI jobs that call a Gateway
    • dashboards and admin panels
    • IDE extensions
    • external bridges that do not need to become channel plugins
    • integration tests with fake or real Gateway transports

    Use the Plugin SDK when code runs inside OpenClaw:

    • provider plugins
    • channel plugins
    • tool or lifecycle hooks
    • agent harness plugins
    • trusted runtime helpers

    App SDK code should import from

    text
    @openclaw/sdk
    . Plugin code should import from documented
    text
    openclaw/plugin-sdk/*
    subpaths. Do not mix the two contracts.

    Related Docs

    • OpenClaw App SDK API design
    • Gateway RPC reference
    • Agent loop
    • Agent runtimes
    • Sessions
    • Background tasks
    • ACP agents
    • Plugin SDK overview

    © 2024 TaskFlow Mirror

    Powered by TaskFlow Sync Engine