注册登录之后
新建令牌


定位你的配置文件
C:\Users\你的用户名.config\opencode\opencode.json
写入 API 配置 用编辑器打开 opencode.json,填入如下示例:
xxxxxxxxxx211{2"$schema": "https://opencode.ai/config.json",3"provider": {4"myweek": {5"npm": "@ai-sdk/openai-compatible",6"name": "week",7"options": {8"baseURL": "https://weekzs.cn/v1",9"apiKey": "你的api密钥"10},11"models": {12"claude-opus-4-6": {13"name": "claude-opus-4-6"14},15"claude-opus-4-6-thinking": {16"name": "claude-opus-4-6-thinking"17}18}19}20}21}
.claude/settings.json中永久配置
x1{2"env": {3"ANTHROPIC_AUTH_TOKEN": "你的密钥",4"ANTHROPIC_BASE_URL": "https://weekzs.cn"5}6}
路径:
Windows: %USERPROFILE%\.claude\settings.json
macOS/Linux: ~/.claude/settings.json
步骤 3:验证连接
xxxxxxxxxx31claude --version23claude
✅ 建议:
使用 /model 动态切换不同模型。
配合 /compact 压缩上下文,降低 Token 消耗。
在 VSCode 安装 Claude Code 插件可获得更直观的交互体验。
CCswtich 里同样可配置 链接为:GitHub - farion1231/cc-switch: A cross-platform desktop All-in-One assistant tool for Claude Code, Clatform desktop All-in-One assistant tool for Claude Code, C
如果桌面客户端无法使用,直接编辑配置文件。
Windows:按 Win + R,输入以下路径回车:
1%USERPROFILE%\.openclaw\openclaw.jsonMac/Linux:路径为 ~/.openclaw/openclaw.json
xxxxxxxxxx201{2 agents: {3 defaults: {4 model: { primary: "myrelay/在这里填模型名" }5 }6 },7 models: {8 mode: "merge",9 providers: {10 myrelay: {11 baseUrl: "https://weekzs.cn/v1",12 apiKey: "sk-你的Key",13 api: "anthropic-messages",14 models: [15 { id: "在这里填模型名" }16 ]17 }18 }19 }20}保存文件,Gateway 自动生效,无需重启。
xxxxxxxxxx11openclaw models status看到模型名出现即成功。有问题运行:
xxxxxxxxxx11openclaw doctorQ:模型名去哪里找? 去中转站的模型广场,找到你要用的模型,复制模型 ID(通常格式如 claude-opus-4-6)。
Q:配置后没反应? 运行 openclaw doctor 查看具体报错。
Q:API 地址要不要加 /v1**?** 手动编辑配置文件时需要加,桌面客户端会自动处理。
连接失败?
检查密钥是否正确复制(完整的 sk-xxx)
确认网络能访问 https://weekzs.cn
模型报错?
确认模型名:claude-opus-4-6
按次计费选带 once 后缀的模型,按量计费选不带的
怎么更新?
xxxxxxxxxx21npm i -g openclaw@latest2openclaw gateway restart咸鱼上购买兑换码
