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:03:01

    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 API design

    This page is the detailed API reference design for the public OpenClaw App SDK. It is intentionally separate from the Plugin SDK.

    note

    `@openclaw/sdk` is the external app/client package for talking to the Gateway. `openclaw/plugin-sdk/*` is the in-process plugin authoring contract. Do not import Plugin SDK subpaths from apps that only need to run agents.

    The public app SDK should be built in two layers:

    1. A low-level generated Gateway client.
    2. A high-level ergonomic wrapper with
      text
      OpenClaw
      ,
      text
      Agent
      ,
      text
      Session
      ,
      text
      Run
      ,
      text
      Task
      ,
      text
      Artifact
      ,
      text
      Approval
      , and
      text
      Environment
      objects.

    Namespace design

    The low-level namespaces should closely follow Gateway resources:

    typescript
    oc.agents.list(); oc.agents.get("main"); oc.agents.create(...); oc.agents.update(...); oc.sessions.list(); oc.sessions.create(...); oc.sessions.resolve(...); oc.sessions.send(...); oc.sessions.messages(...); oc.sessions.fork(...); oc.sessions.compact(...); oc.sessions.abort(...); oc.runs.create(...); oc.runs.get(runId); oc.runs.events(runId, { after }); oc.runs.wait(runId); oc.runs.cancel(runId); oc.tasks.list(); // future API: current SDK throws unsupported oc.tasks.get(taskId); // future API: current SDK throws unsupported oc.tasks.cancel(taskId); // future API: current SDK throws unsupported oc.tasks.events(taskId, { after }); // future API oc.models.list(); oc.models.status(); // Gateway models.authStatus oc.tools.list(); oc.tools.invoke(...); // future API: current SDK throws unsupported oc.artifacts.list({ runId }); // future API: current SDK throws unsupported oc.artifacts.get(artifactId); // future API: current SDK throws unsupported oc.artifacts.download(artifactId); // future API: current SDK throws unsupported oc.approvals.list(); oc.approvals.respond(approvalId, ...); oc.environments.list(); // future API: current SDK throws unsupported oc.environments.create(...); // future API: current SDK throws unsupported oc.environments.status(environmentId); // future API: current SDK throws unsupported oc.environments.delete(environmentId); // future API: current SDK throws unsupported

    High-level wrappers should return objects that make common flows pleasant:

    typescript
    const run = await agent.run(inputOrParams); await run.cancel(); await run.wait(); for await (const event of run.events()) { // normalized event stream } const artifacts = await run.artifacts.list(); const session = await run.session();

    Event contract

    The public SDK should expose versioned, replayable, normalized events.

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

    text
    id
    is a replay cursor. Consumers should be able to reconnect with
    text
    events({ after: id })
    and receive missed events when retention allows.

    Recommended normalized event families:

    EventMeaning
    text
    run.created
    Run accepted.
    text
    run.queued
    Run is waiting for a session lane, runtime, or environment.
    text
    run.started
    Runtime started execution.
    text
    run.completed
    Run finished successfully.
    text
    run.failed
    Run ended with an error.
    text
    run.cancelled
    Run was cancelled.
    text
    run.timed_out
    Run exceeded its timeout.
    text
    assistant.delta
    Assistant text delta.
    text
    assistant.message
    Complete assistant message or replacement.
    text
    thinking.delta
    Reasoning or plan delta, when policy allows exposure.
    text
    tool.call.started
    Tool call began.
    text
    tool.call.delta
    Tool call streamed progress or partial output.
    text
    tool.call.completed
    Tool call returned successfully.
    text
    tool.call.failed
    Tool call failed.
    text
    approval.requested
    A run or tool needs approval.
    text
    approval.resolved
    Approval was granted, denied, expired, or cancelled.
    text
    question.requested
    Runtime asks the user or host app for input.
    text
    question.answered
    Host app supplied an answer.
    text
    artifact.created
    New artifact available.
    text
    artifact.updated
    Existing artifact changed.
    text
    session.created
    Session created.
    text
    session.updated
    Session metadata changed.
    text
    session.compacted
    Session compaction happened.
    text
    task.updated
    Background task state changed.
    text
    git.branch
    Runtime observed or changed branch state.
    text
    git.diff
    Runtime produced or changed a diff.
    text
    git.pr
    Runtime opened, updated, or linked a pull request.

    Runtime-native payloads should be available through

    text
    raw
    , but apps should not have to parse
    text
    raw
    for normal UI.

    Result contract

    text
    Run.wait()
    should return a stable result envelope:

    typescript
    type RunResult = { runId: string; status: "accepted" | "completed" | "failed" | "cancelled" | "timed_out"; sessionId?: string; sessionKey?: string; taskId?: string; startedAt?: string | number; endedAt?: string | number; output?: { text?: string; messages?: SDKMessage[]; }; usage?: { inputTokens?: number; outputTokens?: number; totalTokens?: number; costUsd?: number; }; artifacts?: ArtifactSummary[]; error?: SDKError; };

    The result should be boring and stable. Timestamp values preserve the Gateway shape, so current lifecycle-backed runs usually report epoch millisecond numbers while adapters may still surface ISO strings. Rich UI, tool traces, and runtime-native details belong in events and artifacts.

    text
    accepted
    is a non-terminal wait result: it means the Gateway wait deadline expired before the run produced a lifecycle end/error. It must not be treated as
    text
    timed_out
    ;
    text
    timed_out
    is reserved for a run that exceeded its own runtime timeout.

    Approvals and questions

    Approvals must be first-class because coding agents constantly cross safety boundaries.

    typescript
    run.onApproval(async (request) => { if (request.kind === "tool" && request.toolName === "exec") { return request.approveOnce({ reason: "CI command allowed by policy" }); } return request.askUser(); });

    Approval events should carry:

    • approval id
    • run id and session id
    • request kind
    • requested action summary
    • tool name or environment action
    • risk level
    • available decisions
    • expiration
    • whether the decision can be reused

    Questions are separate from approvals. A question asks the user or host app for information. An approval asks for permission to perform an action.

    ToolSpace model

    Apps need to understand the tool surface without importing plugin internals.

    typescript
    const tools = await run.toolSpace(); for (const tool of tools.list()) { console.log(tool.name, tool.source, tool.requiresApproval); }

    The SDK should expose:

    • normalized tool metadata
    • source: OpenClaw, MCP, plugin, channel, runtime, or app
    • schema summary
    • approval policy
    • runtime compatibility
    • whether a tool is hidden, readonly, write capable, or host capable

    Tool invocation through the SDK should be explicit and scoped. Most apps should run agents, not call arbitrary tools directly.

    Artifact model

    Artifacts should cover more than files.

    typescript
    type ArtifactSummary = { id: string; runId?: string; sessionId?: string; type: | "file" | "patch" | "diff" | "log" | "media" | "screenshot" | "trajectory" | "pull_request" | "workspace"; title?: string; mimeType?: string; sizeBytes?: number; createdAt: string; expiresAt?: string; };

    Common examples:

    • file edits and generated files
    • patch bundles
    • VCS diffs
    • screenshots and media outputs
    • logs and trace bundles
    • pull request links
    • runtime trajectories
    • managed environment workspace snapshots

    Artifact access should support redaction, retention, and download URLs without assuming every artifact is a normal local file.

    Security model

    The app SDK must be explicit about authority.

    Recommended token scopes:

    ScopeAllows
    text
    agent.read
    List and inspect agents.
    text
    agent.run
    Start runs.
    text
    session.read
    Read session metadata and messages.
    text
    session.write
    Create, send to, fork, compact, and abort sessions.
    text
    task.read
    Read background task state.
    text
    task.write
    Cancel or modify task notification policy.
    text
    approval.respond
    Approve or deny requests.
    text
    tools.invoke
    Invoke exposed tools directly.
    text
    artifacts.read
    List and download artifacts.
    text
    environment.write
    Create or destroy managed environments.
    text
    admin
    Administrative operations.

    Defaults:

    • no secret forwarding by default
    • no unrestricted environment variable pass-through
    • secret references instead of secret values
    • explicit sandbox and network policy
    • explicit remote environment retention
    • approvals for host execution unless policy proves otherwise
    • raw runtime events redacted before they leave Gateway unless the caller has a stronger diagnostic scope

    Managed environment provider

    Managed agents should be implemented as environment providers.

    typescript
    type EnvironmentProvider = { id: string; capabilities: { checkout?: boolean; sandbox?: boolean; networkPolicy?: boolean; secrets?: boolean; artifacts?: boolean; logs?: boolean; pullRequests?: boolean; longRunning?: boolean; }; };

    The first implementation does not need to be a hosted SaaS. It can target existing node hosts, ephemeral workspaces, CI-style runners, or Testbox-style environments. The important contract is:

    1. prepare workspace
    2. bind safe environment and secrets
    3. start run
    4. stream events
    5. collect artifacts
    6. clean up or retain by policy

    Once this is stable, a hosted cloud service can implement the same provider contract.

    Package structure

    Recommended packages:

    PackagePurpose
    text
    @openclaw/sdk
    Public high-level SDK and generated low-level Gateway client.
    text
    @openclaw/sdk-react
    Optional React hooks for dashboards and app builders.
    text
    @openclaw/sdk-testing
    Test helpers and fake Gateway server for app integrations.

    The repo already has

    text
    openclaw/plugin-sdk/*
    for plugins. Keep that namespace separate to avoid confusing plugin authors with app developers.

    Generated client strategy

    The low-level client should be generated from versioned Gateway protocol schemas, then wrapped by handwritten ergonomic classes.

    Layering:

    1. Gateway schema source of truth.
    2. Generated low-level TypeScript client.
    3. Runtime validators for external inputs and event payloads.
    4. High-level
      text
      OpenClaw
      ,
      text
      Agent
      ,
      text
      Session
      ,
      text
      Run
      ,
      text
      Task
      , and
      text
      Artifact
      wrappers.
    5. Cookbook examples and integration tests.

    Benefits:

    • protocol drift is visible
    • tests can compare generated methods with Gateway exports
    • App SDK stays independent from Plugin SDK internals
    • low-level consumers still have full protocol access
    • high-level consumers get the small product API

    Related docs

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

    © 2024 TaskFlow Mirror

    Powered by TaskFlow Sync Engine