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:00:08

    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.

    Token use and costs

    Token use & costs

    OpenClaw tracks tokens, not characters. Tokens are model-specific, but most OpenAI-style models average ~4 characters per token for English text.

    How the system prompt is built

    OpenClaw assembles its own system prompt on every run. It includes:

    • Tool list + short descriptions
    • Skills list (only metadata; instructions are loaded on demand with
      text
      read
      ). The compact skills block is bounded by
      text
      skills.limits.maxSkillsPromptChars
      , with optional per-agent override at
      text
      agents.list[].skillsLimits.maxSkillsPromptChars
      .
    • Self-update instructions
    • Workspace + bootstrap files (
      text
      AGENTS.md
      ,
      text
      SOUL.md
      ,
      text
      TOOLS.md
      ,
      text
      IDENTITY.md
      ,
      text
      USER.md
      ,
      text
      HEARTBEAT.md
      ,
      text
      BOOTSTRAP.md
      when new, plus
      text
      MEMORY.md
      when present). Lowercase root
      text
      memory.md
      is not injected; it is legacy repair input for
      text
      openclaw doctor --fix
      when paired with
      text
      MEMORY.md
      . Large files are truncated by
      text
      agents.defaults.bootstrapMaxChars
      (default: 12000), and total bootstrap injection is capped by
      text
      agents.defaults.bootstrapTotalMaxChars
      (default: 60000).
      text
      memory/*.md
      daily files are not part of the normal bootstrap prompt; they remain on-demand via memory tools on ordinary turns, but reset/startup model runs can prepend a one-shot startup-context block with recent daily memory for that first turn. Bare chat
      text
      /new
      and
      text
      /reset
      commands are acknowledged without invoking the model. The startup prelude is controlled by
      text
      agents.defaults.startupContext
      .
    • Time (UTC + user timezone)
    • Reply tags + heartbeat behavior
    • Runtime metadata (host/OS/model/thinking)

    See the full breakdown in System Prompt.

    What counts in the context window

    Everything the model receives counts toward the context limit:

    • System prompt (all sections listed above)
    • Conversation history (user + assistant messages)
    • Tool calls and tool results
    • Attachments/transcripts (images, audio, files)
    • Compaction summaries and pruning artifacts
    • Provider wrappers or safety headers (not visible, but still counted)

    Some runtime-heavy surfaces have their own explicit caps:

    • text
      agents.defaults.contextLimits.memoryGetMaxChars
    • text
      agents.defaults.contextLimits.memoryGetDefaultLines
    • text
      agents.defaults.contextLimits.toolResultMaxChars
    • text
      agents.defaults.contextLimits.postCompactionMaxChars

    Per-agent overrides live under

    text
    agents.list[].contextLimits
    . These knobs are for bounded runtime excerpts and injected runtime-owned blocks. They are separate from bootstrap limits, startup-context limits, and skills prompt limits.

    For images, OpenClaw downscales transcript/tool image payloads before provider calls. Use

    text
    agents.defaults.imageMaxDimensionPx
    (default:
    text
    1200
    ) to tune this:

    • Lower values usually reduce vision-token usage and payload size.
    • Higher values preserve more visual detail for OCR/UI-heavy screenshots.

    For a practical breakdown (per injected file, tools, skills, and system prompt size), use

    text
    /context list
    or
    text
    /context detail
    . See Context.

    How to see current token usage

    Use these in chat:

    • text
      /status
      → emoji‑rich status card with the session model, context usage, last response input/output tokens, and estimated cost (API key only).
    • text
      /usage off|tokens|full
      → appends a per-response usage footer to every reply.
      • Persists per session (stored as
        text
        responseUsage
        ).
      • OAuth auth hides cost (tokens only).
    • text
      /usage cost
      → shows a local cost summary from OpenClaw session logs.

    Other surfaces:

    • TUI/Web TUI:
      text
      /status
      +
      text
      /usage
      are supported.
    • CLI:
      text
      openclaw status --usage
      and
      text
      openclaw channels list
      show normalized provider quota windows (
      text
      X% left
      , not per-response costs). Current usage-window providers: Anthropic, GitHub Copilot, Gemini CLI, OpenAI Codex, MiniMax, Xiaomi, and z.ai.

    Usage surfaces normalize common provider-native field aliases before display. For OpenAI-family Responses traffic, that includes both

    text
    input_tokens
    /
    text
    output_tokens
    and
    text
    prompt_tokens
    /
    text
    completion_tokens
    , so transport-specific field names do not change
    text
    /status
    ,
    text
    /usage
    , or session summaries. Gemini CLI JSON usage is normalized too: reply text comes from
    text
    response
    , and
    text
    stats.cached
    maps to
    text
    cacheRead
    with
    text
    stats.input_tokens - stats.cached
    used when the CLI omits an explicit
    text
    stats.input
    field. For native OpenAI-family Responses traffic, WebSocket/SSE usage aliases are normalized the same way, and totals fall back to normalized input + output when
    text
    total_tokens
    is missing or
    text
    0
    . When the current session snapshot is sparse,
    text
    /status
    and
    text
    session_status
    can also recover token/cache counters and the active runtime model label from the most recent transcript usage log. Existing nonzero live values still take precedence over transcript fallback values, and larger prompt-oriented transcript totals can win when stored totals are missing or smaller. Usage auth for provider quota windows comes from provider-specific hooks when available; otherwise OpenClaw falls back to matching OAuth/API-key credentials from auth profiles, env, or config. Assistant transcript entries persist the same normalized usage shape, including
    text
    usage.cost
    when the active model has pricing configured and the provider returns usage metadata. This gives
    text
    /usage cost
    and transcript-backed session status a stable source even after the live runtime state is gone.

    OpenClaw keeps provider usage accounting separate from the current context snapshot. Provider

    text
    usage.total
    can include cached input, output, and multiple tool-loop model calls, so it is useful for cost and telemetry but can overstate the live context window. Context displays and diagnostics use the latest prompt snapshot (
    text
    promptTokens
    , or the last model call when no prompt snapshot is available) for
    text
    context.used
    .

    Cost estimation (when shown)

    Costs are estimated from your model pricing config:

    text
    models.providers.<provider>.models[].cost

    These are USD per 1M tokens for

    text
    input
    ,
    text
    output
    ,
    text
    cacheRead
    , and
    text
    cacheWrite
    . If pricing is missing, OpenClaw shows tokens only. OAuth tokens never show dollar cost.

    Gateway startup also performs an optional background pricing bootstrap for configured model refs that do not already have local pricing. That bootstrap fetches remote OpenRouter and LiteLLM pricing catalogs. Set

    text
    models.pricing.enabled: false
    to skip those startup catalog fetches on offline or restricted networks; explicit
    text
    models.providers.*.models[].cost
    entries continue to drive local cost estimates.

    Cache TTL and pruning impact

    Provider prompt caching only applies within the cache TTL window. OpenClaw can optionally run cache-ttl pruning: it prunes the session once the cache TTL has expired, then resets the cache window so subsequent requests can re-use the freshly cached context instead of re-caching the full history. This keeps cache write costs lower when a session goes idle past the TTL.

    Configure it in Gateway configuration and see the behavior details in Session pruning.

    Heartbeat can keep the cache warm across idle gaps. If your model cache TTL is

    text
    1h
    , setting the heartbeat interval just under that (e.g.,
    text
    55m
    ) can avoid re-caching the full prompt, reducing cache write costs.

    In multi-agent setups, you can keep one shared model config and tune cache behavior per agent with

    text
    agents.list[].params.cacheRetention
    .

    For a full knob-by-knob guide, see Prompt Caching.

    For Anthropic API pricing, cache reads are significantly cheaper than input tokens, while cache writes are billed at a higher multiplier. See Anthropic’s prompt caching pricing for the latest rates and TTL multipliers: https://docs.anthropic.com/docs/build-with-claude/prompt-caching

    Example: keep 1h cache warm with heartbeat

    yaml
    agents: defaults: model: primary: "anthropic/claude-opus-4-6" models: "anthropic/claude-opus-4-6": params: cacheRetention: "long" heartbeat: every: "55m"

    Example: mixed traffic with per-agent cache strategy

    yaml
    agents: defaults: model: primary: "anthropic/claude-opus-4-6" models: "anthropic/claude-opus-4-6": params: cacheRetention: "long" # default baseline for most agents list: - id: "research" default: true heartbeat: every: "55m" # keep long cache warm for deep sessions - id: "alerts" params: cacheRetention: "none" # avoid cache writes for bursty notifications

    text
    agents.list[].params
    merges on top of the selected model's
    text
    params
    , so you can override only
    text
    cacheRetention
    and inherit other model defaults unchanged.

    Example: enable Anthropic 1M context beta header

    Anthropic's 1M context window is currently beta-gated. OpenClaw can inject the required

    text
    anthropic-beta
    value when you enable
    text
    context1m
    on supported Opus or Sonnet models.

    yaml
    agents: defaults: models: "anthropic/claude-opus-4-6": params: context1m: true

    This maps to Anthropic's

    text
    context-1m-2025-08-07
    beta header.

    This only applies when

    text
    context1m: true
    is set on that model entry.

    Requirement: the credential must be eligible for long-context usage. If not, Anthropic responds with a provider-side rate limit error for that request.

    If you authenticate Anthropic with OAuth/subscription tokens (

    text
    sk-ant-oat-*
    ), OpenClaw skips the
    text
    context-1m-*
    beta header because Anthropic currently rejects that combination with HTTP 401.

    Tips for reducing token pressure

    • Use
      text
      /compact
      to summarize long sessions.
    • Trim large tool outputs in your workflows.
    • Lower
      text
      agents.defaults.imageMaxDimensionPx
      for screenshot-heavy sessions.
    • Keep skill descriptions short (skill list is injected into the prompt).
    • Prefer smaller models for verbose, exploratory work.

    See Skills for the exact skill list overhead formula.

    Related

    • API usage and costs
    • Prompt caching
    • Usage tracking

    © 2024 TaskFlow Mirror

    Powered by TaskFlow Sync Engine