Skip to main content

openclaw agent

Execute a single agent interaction through the OpenClaw Gateway.

Usage

Options

string
required
The message or prompt to send to the agent
string
Recipient identifier (E.164 phone number, user ID, etc.)
string
Explicit session ID to use or create
string
Session key for routing (format: agent:sessionId)
string
Agent ID to use for this interaction
string
Thinking level: off, low, medium, high, or xhighControls how much reasoning the agent performs before responding.
string
One-time thinking level override (same values as —thinking)
string
Verbose output level: on, full, or off
number
Timeout in seconds (0 means no timeout)
boolean
Deliver the response to the recipient via their channel
string
Message ID to reply to
string
Thread ID for threaded conversations
string
Message channel (telegram, discord, slack, etc.)
string
Override channel for reply delivery
string
Agent lane identifier for routing
string
Custom run ID for tracking (defaults to session ID)
string
Additional system prompt to inject
string
Comma-separated list of image file paths to include

Thinking Levels

The --thinking flag controls the agent’s reasoning process:
  • off: No explicit reasoning, direct responses
  • low: Minimal reasoning for simple queries
  • medium: Moderate reasoning for typical tasks
  • high: Deep reasoning for complex problems
  • xhigh: Extended reasoning (only for supported models)
The xhigh thinking level is only available for specific models like o1-preview and o1-mini.

Delivery Options

By default, agent responses are printed to stdout. Use --deliver to send responses through the configured channel:

Examples

You must specify at least one of --to, --session-id, --session-key, or --agent to identify the target session.

Session Persistence

Agent conversations are automatically persisted to session files. Each session maintains:
  • Conversation history
  • Model preferences
  • Thinking level settings
  • Skills snapshot
  • Authentication profile
Sessions are stored in ~/.openclaw/sessions/ by default.

Model Selection

The agent uses the configured default model unless overridden in the session. To change models:

Error Handling

If an agent turn fails, the CLI returns a non-zero exit code:

Environment Variables

number
Default timeout in seconds for agent operations
string
Default thinking level (off, low, medium, high, xhigh)
  • agents - Manage isolated agents and workspaces
  • sessions - List stored conversation sessions
  • models - Manage model configurations