Inference CLI
openclaw infer is the canonical headless surface for provider-backed inference workflows.
It intentionally exposes capability families, not raw gateway RPC names and not raw agent tool ids.
Turn infer into a skill
Copy and paste this to an agent:- map common user intents to the correct infer subcommand
- include a few canonical infer examples for the workflows it covers
- prefer
openclaw infer ...in examples and suggestions - avoid re-documenting the entire infer surface inside the skill body
openclaw infer model runopenclaw infer image generateopenclaw infer audio transcribeopenclaw infer tts convertopenclaw infer web searchopenclaw infer embedding create
Why use infer
openclaw infer provides one consistent CLI for provider-backed inference tasks inside OpenClaw.
Benefits:
- Use the providers and models already configured in OpenClaw instead of wiring up one-off wrappers for each backend.
- Keep model, image, audio transcription, TTS, video, web, and embedding workflows under one command tree.
- Use a stable
--jsonoutput shape for scripts, automation, and agent-driven workflows. - Prefer a first-party OpenClaw surface when the task is fundamentally “run inference.”
- Use the normal local path without requiring the gateway for most infer commands.
Command tree
Common tasks
This table maps common inference tasks to the corresponding infer command.| Task | Command | Notes |
|---|---|---|
| Run a text/model prompt | openclaw infer model run --prompt "..." --json | Uses the normal local path by default |
| Generate an image | openclaw infer image generate --prompt "..." --json | Use image edit when starting from an existing file |
| Describe an image file | openclaw infer image describe --file ./image.png --json | --model must be <provider/model> |
| Transcribe audio | openclaw infer audio transcribe --file ./memo.m4a --json | --model must be <provider/model> |
| Synthesize speech | openclaw infer tts convert --text "..." --output ./speech.mp3 --json | tts status is gateway-oriented |
| Generate a video | openclaw infer video generate --prompt "..." --json | |
| Describe a video file | openclaw infer video describe --file ./clip.mp4 --json | --model must be <provider/model> |
| Search the web | openclaw infer web search --query "..." --json | |
| Fetch a web page | openclaw infer web fetch --url https://example.com --json | |
| Create embeddings | openclaw infer embedding create --text "..." --json |
Behavior
openclaw infer ...is the primary CLI surface for these workflows.- Use
--jsonwhen the output will be consumed by another command or script. - Use
--provideror--model provider/modelwhen a specific backend is required. - For
image describe,audio transcribe, andvideo describe,--modelmust use the form<provider/model>. - Stateless execution commands default to local.
- Gateway-managed state commands default to gateway.
- The normal local path does not require the gateway to be running.
Model
Usemodel for provider-backed text inference and model/provider inspection.
model runreuses the agent runtime so provider/model overrides behave like normal agent execution.model auth login,model auth logout, andmodel auth statusmanage saved provider auth state.
Image
Useimage for generation, edit, and description.
- Use
image editwhen starting from existing input files. - For
image describe,--modelmust be<provider/model>.
Audio
Useaudio for file transcription.
audio transcribeis for file transcription, not realtime session management.--modelmust be<provider/model>.
TTS
Usetts for speech synthesis and TTS provider state.
tts statusdefaults to gateway because it reflects gateway-managed TTS state.- Use
tts providers,tts voices, andtts set-providerto inspect and configure TTS behavior.
Video
Usevideo for generation and description.
--modelmust be<provider/model>forvideo describe.
Web
Useweb for search and fetch workflows.
- Use
web providersto inspect available, configured, and selected providers.
Embedding
Useembedding for vector creation and embedding provider inspection.
JSON output
Infer commands normalize JSON output under a shared envelope:okcapabilitytransportprovidermodelattemptsoutputserror
Common pitfalls
Notes
openclaw capability ...is an alias foropenclaw infer ....