VPN07

2026 OpenClaw Models 指令全解析:AI 模型管理、認證設定與備援配置問答

2026-02-20 閱讀約 18 分鐘 AI工具

本文說明:OpenClaw 支援 Claude、GPT、Gemini、本地模型等多種 AI 模型。models 指令群讓你完整管理模型選擇、認證憑證、備援設定。本文同時涵蓋 memory(記憶管理)和 approvals(操作授權)指令,完整解析每個子命令。

10+
Models 子命令
8+
支援 AI 提供商
1000Mbps
VPN07 頻寬
$1.5
VPN07/月

models 基礎:list 與 status

Q1 openclaw modelsopenclaw models status 有什麼差別?

A:openclaw modelsopenclaw models status 的別名,兩者完全相同。models status 顯示:

  • 當前設定的主要模型和圖片模型
  • 各認證 Profile 的 OAuth 狀態和到期時間
  • 備援模型列表
  • API 配額使用量(需要 --usage 或 --probe)
# 快速查看模型狀態
openclaw models
# 詳細狀態(含 JSON)
openclaw models status --json
# 純文字格式(無顏色)
openclaw models status --plain
# 即時探測(會消耗 token)
openclaw models status --probe
# 檢查 token 是否過期(exit code 非零表示問題)
openclaw models status --check

Q2 openclaw models list 如何查看所有可用模型?

A:models list 列出 OpenClaw 支援的所有 AI 模型,可依提供商篩選:

# 列出所有模型
openclaw models list
# 只列出 Anthropic 模型
openclaw models list --provider anthropic
# 只列出本地模型
openclaw models list --local
# 列出所有(含不常用)
openclaw models list --all
# 輸出 JSON
openclaw models list --json

models set 與 set-image:切換 AI 模型

Q3 openclaw models set 如何更改預設 AI 模型?

A:models set 更新 agents.defaults.model.primary 設定值,切換所有 Agent 使用的預設主要模型:

# 切換到 Claude Opus 4.5
openclaw models set claude-opus-4-5
# 切換到 GPT-5
openclaw models set gpt-5
# 切換到 Gemini
openclaw models set gemini-2-pro
# 切換到本地 Llama 模型
openclaw models set llama-3.1-70b-local

⚠️ 切換模型後需要重啟 Gateway 才能生效:openclaw gateway restart

Q4 openclaw models set-image 是用來設定什麼的?

A:models set-image 設定用於圖像生成和分析的專屬圖片模型(agents.defaults.imageModel.primary),與文字模型分開設定:

# 設定圖片模型
openclaw models set-image dall-e-3
# 設定為 Gemini 視覺模型
openclaw models set-image gemini-pro-vision

models aliases 與 fallbacks:別名與備援設定

Q5 models aliases 如何建立模型別名?為什麼需要?

A:模型別名讓你用簡短名稱代替長模型 ID,方便在設定中使用。例如把 claude-opus-4-5 別名為 best

# 列出所有別名
openclaw models aliases list
# 新增別名
openclaw models aliases add best claude-opus-4-5
# 移除別名
openclaw models aliases remove best
# JSON 格式輸出
openclaw models aliases list --json

Q6 models fallbacks 如何設定備援模型?重要性是什麼?

A:備援模型(fallbacks)是當主要模型不可用時(API 超限、服務中斷)自動切換的備用選項,確保 OpenClaw 持續運作:

# 查看備援列表
openclaw models fallbacks list
# 新增備援模型(依序嘗試)
openclaw models fallbacks add gpt-5
openclaw models fallbacks add gemini-2-pro
# 移除備援
openclaw models fallbacks remove gpt-5
# 清除所有備援
openclaw models fallbacks clear

Q7 models image-fallbacksmodels fallbacks 有什麼差別?

A:兩者結構完全相同,但作用對象不同:fallbacks 是文字生成模型的備援,image-fallbacks 是圖片模型的備援。指令用法完全一樣,只是命令名稱不同。建議同時設定兩組備援,確保所有任務都有保障。

models scan 與 auth:自動掃描與認證管理

Q8 openclaw models scan 是什麼?什麼時候用?

A:models scan 自動掃描和測試你的 API 認證,找出最佳可用模型並可自動設為預設。適合初次設定或確認 API Key 是否有效:

# 掃描所有可用模型
openclaw models scan
# 掃描後自動設為預設模型
openclaw models scan --set-default
# 掃描後同時設定圖片模型
openclaw models scan --set-default --set-image
# 只掃描特定提供商
openclaw models scan --provider anthropic
# 跳過實際探測(只看設定,不發請求)
openclaw models scan --no-probe
# 非互動模式(自動接受)
openclaw models scan --yes --set-default

Q9 openclaw models auth add 如何新增 API 認證?

A:models auth add 是互動式認證設定精靈,引導你輸入不同提供商的 API Key:

# 互動式新增認證
openclaw models auth add

精靈會引導你選擇提供商(Anthropic/OpenAI/Gemini/OpenRouter/本地等),並安全存儲 API Key。

Q10 models auth setup-tokenpaste-token 各在什麼情況下用?

models auth setup-token(推薦用於 Anthropic)

對接 claude setup-token 流程,從現有的 Claude CLI 授權中取得 Token。這是官方推薦的 Anthropic 認證方式。

claude setup-token # 先在 Claude CLI 登入
openclaw models auth setup-token --provider anthropic

models auth paste-token(手動貼上 Token)

手動貼入 Token 字串,適合從其他管道取得的 Token 或腳本自動化設定。

openclaw models auth paste-token --provider anthropic --expires-in 365d

Q11 models auth order 是什麼?如何設定多組認證的優先順序?

A:如果你為同一個提供商設定了多組 API Key(例如個人帳號和公司帳號都有 Anthropic),auth order 控制使用哪一組:

# 查看當前認證優先順序
openclaw models auth order get --provider anthropic
# 設定使用哪個 Profile 的認證
openclaw models auth order set --provider anthropic profile-id-1 profile-id-2
# 針對特定 Agent 設定(覆寫全域設定)
openclaw models auth order set --provider anthropic --agent my-agent profile-id-1
# 清除特定提供商的順序設定
openclaw models auth order clear --provider anthropic

memory 指令:AI 記憶搜尋與管理

Q12 OpenClaw 的記憶是如何存儲的?memory 指令管理什麼?

A:OpenClaw 記憶存儲在 MEMORY.md(主記憶)和 memory/*.md(分類記憶)中,純文字格式,你可以直接編輯。memory 指令讓你對這些記憶進行語義向量搜尋(不是關鍵字搜尋),找到真正相關的記憶片段。

Q13 openclaw memory search 如何使用語義搜尋?

A:輸入自然語言描述,系統會找到語義相近的記憶內容(不需要完全匹配關鍵字):

# 搜尋關於工作偏好的記憶
openclaw memory search "我喜歡怎麼工作"
# 搜尋關於家庭的記憶
openclaw memory search "family members"
# 搜尋飲食喜好
openclaw memory search "food preferences diet"

Q14 openclaw memory indexmemory status 分別做什麼?

memory index

重新建立記憶的向量索引。手動修改 MEMORY.md 後需要執行此指令,讓新內容可被語義搜尋到。

openclaw memory index

memory status

顯示記憶索引的統計資訊:已索引的記憶條目數量、索引建立時間、索引大小等。

openclaw memory status

approvals、pairing 與 sessions 指令

Q15 openclaw approvals 是什麼安全機制?如何設定?

A:Approvals 是 OpenClaw 的操作授權機制,控制哪些敏感操作需要人工確認。例如刪除檔案、發送郵件等高風險動作,可以要求 AI 先徵得你的同意。

# 查看當前授權設定
openclaw approvals get
# 設定授權模式
openclaw approvals set
# 新增到允許清單(無需每次確認)
openclaw approvals allowlist add bash_execute
# 從允許清單移除
openclaw approvals allowlist remove bash_execute

Q16 openclaw pairing 是什麼?如何審批 DM 配對請求?

A:當新用戶嘗試透過 DM 與你的 OpenClaw 互動時,系統會生成配對請求(Pairing Request),需要你審批後才能建立連線,防止未授權訪問:

# 列出待審批的配對請求
openclaw pairing list
# 審批特定配對請求
openclaw pairing approve REQUEST_ID
# 審批並發送通知
openclaw pairing approve REQUEST_ID --notify

Q17 openclaw sessions 如何查看對話會話記錄?

A:sessions 列出所有存儲的對話會話,每個會話代表一段獨立的對話上下文。

# 列出所有會話
openclaw sessions
# 只顯示活躍的會話
openclaw sessions --active 24h
# 詳細資訊
openclaw sessions --verbose
# JSON 格式輸出
openclaw sessions --json

channels 指令:頻道管理完整解析

Q18 openclaw channels 支援哪些通訊頻道?

A:OpenClaw 支援以下頻道:

WhatsApp
Telegram
Discord
Slack
Signal
iMessage
Google Chat
MS Teams

Q19 channels liststatusaddremovelogs 各自功能?

channels list [--json] [--no-usage]

列出所有已設定的頻道和認證 Profiles,加 --json 取得配額資訊

channels status [--probe]

檢查 Gateway 連通性和頻道健康狀態,--probe 做額外連線測試

channels add --channel telegram --token TOKEN

新增頻道設定,無旗標時啟動互動式精靈

channels remove --channel telegram --delete

停用或刪除頻道設定(加 --delete 才真正移除)

channels logs [--lines 200] [--channel all]

查看頻道相關的 Gateway 日誌,排查連線問題

Q20 台灣用戶 channels status 顯示連線失敗,如何解決?

A:台灣訪問 Anthropic API 和部分通訊服務(如 Discord、Slack)可能受網路限制影響。搭配 VPN07 可以解決:

❌ 直連
頻道連線不穩定
✅ VPN07
所有頻道穩定連線
$1.5/月
最划算的解法
OpenClaw 模型 API 最佳拍檔
VPN07 – AI 模型連線加速首選

OpenClaw 連接 Anthropic、OpenAI、Gemini 等 AI 模型時,台灣用戶直連延遲高、不穩定。VPN07 擁有 1000Mbps 極速頻寬、全球 70+ 節點覆蓋、十年穩定運營,讓 API 請求快速穩定。每月只要 $1.5,享受 30 天退款保證。

$1.5
每月費用
1000Mbps
極速頻寬
70+
全球節點
30天
退款保證
月費$1.5 · 運營十年
免費試用 VPN07