openclaw infer
面向 provider 的无头推理 CLI,统一封装文本、图像、音频、TTS、视频、Web 搜索和 Embedding 工作流。
别名:openclaw capability ...
命令树
openclaw infer
list / inspect
model run / list / inspect / providers / auth login|logout|status
image generate / edit / describe / describe-many / providers
audio transcribe / providers
tts convert / voices / providers / status / enable / disable / set-provider
video generate / describe / providers
web search / fetch / providers
embedding create / providers
常用任务速查
| 任务 | 命令 |
|---|---|
| 文本推理 | openclaw infer model run --prompt "..." --json |
| 图像理解 | openclaw infer model run --prompt "..." --file ./img.png --model provider/model |
| 图像生成 | openclaw infer image generate --prompt "..." --json |
| 图像描述 | openclaw infer image describe --file ./photo.jpg --json |
| 音频转录 | openclaw infer audio transcribe --file ./memo.m4a --json |
| 语音合成 | openclaw infer tts convert --text "..." --output ./out.mp3 --json |
| 视频生成 | openclaw infer video generate --prompt "..." --json |
| Web 搜索 | openclaw infer web search --query "..." --json |
| Embedding | openclaw infer embedding create --text "..." --json |
model run
openclaw infer model run --prompt "Reply with exactly: pong" --json
openclaw infer model run --prompt "..." --model openai/gpt-4.1 --json
openclaw infer model run --prompt "..." --thinking high --json
openclaw infer model run --local --model anthropic/claude-sonnet-4-6 --prompt "pong" --json
openclaw infer model run --gateway --model openai/gpt-4.1 --prompt "..." --json- 默认走本地路径,不需要 Gateway 运行
--thinking支持:off/minimal/low/medium/high/adaptive/xhigh/max--file支持图像输入(PNG/JPEG/WebP),可重复使用--gateway模式需要 trusted operator 凭证
image
openclaw infer image generate --prompt "friendly lobster" --json
openclaw infer image generate --model openai/gpt-image-1.5 --output-format png --background transparent --prompt "..." --json
openclaw infer image edit --file ./logo.png --model openai/gpt-image-1.5 --prompt "remove background" --json
openclaw infer image describe --file ./photo.jpg --prompt "Extract merchant and total" --json
openclaw infer image describe-many --file ./before.png --file ./after.png --prompt "Compare UI changes" --json--model必须是<provider/model>格式--output-format png --background transparent用于透明背景输出
audio / tts / video / web / embedding
openclaw infer audio transcribe --file ./memo.m4a --model openai/whisper-1 --json
openclaw infer tts convert --text "hello" --output ./hello.mp3 --json
openclaw infer video generate --prompt "sunset" --resolution 768P --duration 6 --json
openclaw infer web search --query "OpenClaw docs" --json
openclaw infer web fetch --url https://docs.openclaw.ai/cli/infer --json
openclaw infer embedding create --text "customer support ticket" --model openai/text-embedding-3-large --jsonJSON 输出格式
{
"ok": true,
"capability": "image.generate",
"transport": "local",
"provider": "openai",
"model": "gpt-image-2",
"attempts": [],
"outputs": []
}稳定字段:ok / capability / transport / provider / model / attempts / outputs / error
常见错误
# 错误:多余的 media 层级
openclaw infer media image generate ...
# 正确
openclaw infer image generate ...
# 错误:model 缺少 provider 前缀
openclaw infer audio transcribe --model whisper-1
# 正确
openclaw infer audio transcribe --model openai/whisper-1相关链接
- cli-models — 模型管理命令
- models — 模型选择概念