Anthropic 构建了 Claude 模型家族。OpenClaw 支持两种认证方式:Documentation Index
Fetch the complete documentation index at: https://openclaw.zhcndoc.com/llms.txt
Use this file to discover all available pages before exploring further.
- API key — 直接访问 Anthropic API,并按使用量计费(
anthropic/*模型) - Claude CLI — 复用同一主机上现有的 Claude CLI 登录
开始使用
- API key
- Claude CLI
Thinking 默认值(Claude 4.6)
当未显式设置 thinking 等级时,Claude 4.6 模型在 OpenClaw 中默认使用adaptive thinking。
可通过 /think:<level> 按消息覆盖,或在模型参数中设置:
相关 Anthropic 文档:
提示词缓存
OpenClaw 支持 Anthropic 的提示词缓存功能,适用于 API key 认证。| 值 | 缓存时长 | 说明 |
|---|---|---|
"short"(默认) | 5 分钟 | 针对 API key 认证自动应用 |
"long" | 1 小时 | 扩展缓存 |
"none" | 不缓存 | 禁用提示词缓存 |
按代理覆盖缓存
按代理覆盖缓存
先以模型级参数作为基础,再通过 配置合并顺序:
agents.list[].params 覆盖特定代理: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 key 智能默认值也会为 Claude-on-Bedrock 引用填入
cacheRetention: "short"。
高级配置
快速模式
快速模式
OpenClaw 的共享
/fast 开关支持直接 Anthropic 流量(API key 和到 api.anthropic.com 的 OAuth)。| 命令 | 映射为 |
|---|---|
/fast on | service_tier: "auto" |
/fast off | service_tier: "standard_only" |
- 仅对直接
api.anthropic.com请求注入。代理路由不会改动service_tier。 - 当两者都设置时,显式的
serviceTier或service_tier参数会覆盖/fast。 - 在没有 Priority Tier 容量的账户上,
service_tier: "auto"可能会解析为standard。
媒体理解(图片和 PDF)
媒体理解(图片和 PDF)
随附的 Anthropic 插件会注册图片和 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 context
Claude Opus 4.7 1M context
anthropic/claude-opus-4.7 及其 claude-cli 变体默认拥有 1M 上下文
窗口——无需 params.context1m: true。故障排除
401 errors / token suddenly invalid
401 errors / token suddenly invalid
Anthropic token 认证会过期,也可能被撤销。对于新配置,建议改用 Anthropic API key。
No API key found for provider "anthropic"
No API key found for provider "anthropic"
Anthropic 认证是按代理生效的——新代理不会继承主代理的密钥。请为该代理重新运行初始化(或在网关主机上配置 API key),然后用
openclaw models status 验证。No credentials found for profile "anthropic:default"
No credentials found for profile "anthropic:default"
运行
openclaw models status 查看当前激活的是哪个认证配置文件。重新运行初始化,或为该配置文件路径配置 API key。No available auth profile (all in cooldown)
No available auth profile (all in cooldown)
检查
openclaw models status --json 中的 auth.unusableProfiles。Anthropic 的速率限制冷却可能是按模型范围生效的,因此同组中的另一个 Anthropic 模型也许仍可使用。添加另一个 Anthropic 配置文件,或等待冷却结束。更多帮助:Troubleshooting 和 FAQ。
相关内容
模型选择
选择提供方、模型引用和故障转移行为。
CLI 后端
Claude CLI 后端的设置和运行时细节。
提示词缓存
提示词缓存如何在各提供方之间工作。
OAuth 和认证
认证细节和凭证复用规则。