Anthropic 建構了 Claude 模型系列。OpenClaw 支援兩種驗證路徑:Documentation Index
Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
- API 金鑰 — 直接存取 Anthropic API,並依使用量計費(
anthropic/*模型) - Claude CLI — 重用同一台主機上既有的 Claude CLI 登入
開始使用
- API 金鑰
- Claude CLI
Thinking 預設值(Claude 4.6)
當未設定明確的 Thinking 層級時,Claude 4.6 模型在 OpenClaw 中預設為adaptive thinking。
可使用 /think:<level> 針對每則訊息覆寫,或在模型參數中覆寫:
相關 Anthropic 文件:
提示快取
OpenClaw 支援 Anthropic 的提示快取功能,用於 API 金鑰驗證。| 值 | 快取時間 | 說明 |
|---|---|---|
"short"(預設) | 5 分鐘 | 會自動套用於 API 金鑰驗證 |
"long" | 1 小時 | 延長快取 |
"none" | 不快取 | 停用提示快取 |
每個 agent 的快取覆寫
每個 agent 的快取覆寫
使用模型層級參數作為基準,然後透過 設定合併順序:
agents.list[].params 覆寫特定 agent:agents.defaults.models["provider/model"].paramsagents.list[].params(符合id,依鍵覆寫)
Bedrock Claude 注意事項
Bedrock Claude 注意事項
- Bedrock 上的 Anthropic Claude 模型(
amazon-bedrock/*anthropic.claude*)在設定後會接受cacheRetention透傳。 - 非 Anthropic 的 Bedrock 模型會在執行階段被強制設為
cacheRetention: "none"。 - 當未設定明確值時,API 金鑰智慧預設值也會為 Claude-on-Bedrock 參照植入
cacheRetention: "short"。
進階設定
快速模式
快速模式
OpenClaw 的共用
/fast 切換支援直接 Anthropic 流量(API 金鑰與 OAuth 至 api.anthropic.com)。| 指令 | 對應至 |
|---|---|
/fast on | service_tier: "auto" |
/fast off | service_tier: "standard_only" |
- 僅會注入至直接
api.anthropic.com請求。Proxy 路由會保留service_tier不變。 - 當兩者皆設定時,明確的
serviceTier或service_tier參數會覆寫/fast。 - 在沒有 Priority Tier 容量的帳戶上,
service_tier: "auto"可能會解析為standard。
媒體理解(圖片與 PDF)
媒體理解(圖片與 PDF)
內建的 Anthropic Plugin 會註冊圖片與 PDF 理解。OpenClaw
會從已設定的 Anthropic 驗證自動解析媒體能力,不需要
額外設定。
當圖片或 PDF 附加到對話時,OpenClaw 會自動
透過 Anthropic 媒體理解供應商進行路由。
| 屬性 | 值 |
|---|---|
| 預設模型 | claude-opus-4-6 |
| 支援的輸入 | 圖片、PDF 文件 |
1M 上下文視窗(beta)
1M 上下文視窗(beta)
Anthropic 的 1M 上下文視窗受 beta 門檻限制。可針對每個模型啟用:OpenClaw 會在請求上將其對應為
anthropic-beta: context-1m-2025-08-07。params.context1m: true 也會套用至 Claude CLI 後端
(claude-cli/*)中符合資格的 Opus 與 Sonnet 模型,將這些 CLI 工作階段的執行階段
上下文視窗擴展為與直接 API 行為一致。Claude Opus 4.7 1M 上下文
Claude Opus 4.7 1M 上下文
anthropic/claude-opus-4.7 及其 claude-cli 變體預設具備 1M 上下文
視窗,不需要 params.context1m: true。疑難排解
401 錯誤 / 權杖突然無效
401 錯誤 / 權杖突然無效
Anthropic 權杖驗證會過期,也可能被撤銷。對於新的設定,請改用 Anthropic API 金鑰。
找不到 provider "anthropic" 的 API 金鑰
找不到 provider "anthropic" 的 API 金鑰
Anthropic 驗證是依 agent 而定,新的 agent 不會繼承主要 agent 的金鑰。請為該 agent 重新執行初始設定(或在 gateway 主機上設定 API 金鑰),然後使用
openclaw models status 驗證。找不到 profile "anthropic:default" 的憑證
找不到 profile "anthropic:default" 的憑證
執行
openclaw models status 查看目前啟用的驗證 profile。請重新執行初始設定,或為該 profile 路徑設定 API 金鑰。沒有可用的驗證 profile(全部都在冷卻中)
沒有可用的驗證 profile(全部都在冷卻中)
檢查
openclaw models status --json 中的 auth.unusableProfiles。Anthropic 速率限制冷卻可能以模型為範圍,因此同層級的 Anthropic 模型可能仍可使用。新增另一個 Anthropic profile,或等待冷卻結束。相關
模型選擇
選擇供應商、模型參照與容錯移轉行為。
CLI 後端
Claude CLI 後端設定與執行階段細節。
提示快取
提示快取在各供應商之間如何運作。
OAuth 與驗證
驗證細節與憑證重用規則。