Claude Desktop 接入指南
本页介绍如何在 Claude Desktop 中启用第三方推理配置,并通过 AIRouter 中转站接入 Claude 模型。
适用场景
如果你希望在 Claude Desktop 里使用自己的 AIRouter API Key,而不是直接走 Claude 官方账号,可以使用 Claude Desktop 的第三方推理 Gateway 模式。
重要区别
Claude Desktop 的第三方推理 Gateway 使用 Anthropic Messages API,不是 OpenAI 兼容的 /v1/chat/completions 接口。
AIRouter 的 OpenAI 兼容地址是 https://aigc.aochengcloud.com/v1,适合 SDK、curl、Codex 等工具;Claude Desktop 需要填写 Claude 原生兼容地址:https://aigc.aochengcloud.com/claude。
一、下载安装 Claude Desktop
打开 Claude 官方下载页:
https://claude.ai/download
根据系统选择安装包:
| 系统 | 说明 |
|---|---|
| macOS | 下载 .dmg 后拖入 Applications |
| Windows | 下载并安装 Windows 版本 |
安装完成后先启动 Claude Desktop,但不要急着登录 Claude 官方账号。第三方推理配置建议在登录页完成。
二、准备 AIRouter API Key
- 登录 AIRouter 控制台:
https://aigc.aochengcloud.com。 - 进入「API Keys」页面。
- 创建或复制一个可用 API Key。
- 确认账号余额、模型权限和 API Key 状态正常。
提示
如果你已经能用同一个 Key 调用 AIRouter 的 Claude Code 地址或 Claude 模型,说明 Key 和账号权限大概率没问题。Claude Desktop 接入失败时,优先检查 Gateway 地址和本地配置是否生效。
三、启用 Developer Mode
Claude Desktop 的第三方推理配置入口默认可能不可见,需要先启用开发者模式。
macOS
- 打开 Claude Desktop。
- 保持在登录页。
- 在系统顶部菜单栏中选择「Help」。
- 进入「Troubleshooting」。
- 点击「Enable Developer Mode」。
- 菜单栏出现「Developer」后,点击「Developer」→「Configure third-party inference」。
Windows
- 打开 Claude Desktop。
- 保持在登录页。
- 点击左上角应用菜单。
- 进入「Help」→「Troubleshooting」。
- 点击「Enable Developer Mode」。
- 再进入「Developer」→「Configure third-party inference」。
如果看不到 Developer 菜单,请完全退出 Claude Desktop 后重新打开。
四、配置 Gateway
在「Configure third-party inference」窗口中,进入「Connection」配置区,按下面填写。
| 字段 | 填写内容 |
|---|---|
| Inference provider | Gateway |
| Gateway base URL | https://aigc.aochengcloud.com/claude |
| Gateway API key | 你的 AIRouter API Key |
| Gateway auth scheme | bearer 或保持默认 |
| Gateway extra headers | 一般留空 |
地址不要写错
Claude Desktop 会自动在 Gateway base URL 后面请求 /v1/messages 和 /v1/models。
因此这里应填写:
https://aigc.aochengcloud.com/claude
不要填写:
https://aigc.aochengcloud.com/v1
https://aigc.aochengcloud.com/claude/v1
https://aigc.aochengcloud.com/claude/
五、模型配置
Claude Desktop Gateway 模式会尝试从 Gateway 的 GET /v1/models 读取模型列表。如果模型列表能正常返回,通常不需要手动填写模型。
如果模型没有自动出现,可以在「Identity & models」中手动添加模型 ID。模型 ID 需要以 AIRouter 控制台或日志中实际可用的 Claude 模型为准,例如:
claude-sonnet-4-6
claude-haiku-4-5-20251001
注意
不要照抄旧文章里的模型名。模型名称、价格、上下文长度和账号权限可能会调整,接入前请以 AIRouter「模型」页面、/v1/models 查询结果或售后公告为准。
六、应用本地配置
填写完成后:
- 点击「Apply locally」。
- 等待 Claude Desktop 自动重启。
- 回到登录页后,选择通过 Gateway 或第三方推理配置进入。
- 发送一个简单问题,例如“用一句话介绍你当前使用的模型”。
- 打开 AIRouter「使用日志」,确认是否出现 Claude Desktop 发起的请求。
如果 AIRouter 日志中出现成功请求,说明 Claude Desktop 已经接入中转站。
七、本地配置文件位置
一般用户推荐使用界面里的「Configure third-party inference」配置,不建议手写配置文件。新版 Claude Desktop 会把本地第三方推理配置写入配置库目录。
| 系统 | 本地配置位置 |
|---|---|
| macOS | ~/Library/Application Support/Claude-3p/configLibrary/ |
| Windows | %LOCALAPPDATA%\Claude-3p\configLibrary\ |
这个目录通常包含:
| 文件 | 说明 |
|---|---|
_meta.json | 记录当前应用的是哪份配置 |
<id>.json | 具体配置内容 |
提示
网上一些旧教程可能会提到直接编辑 claude_desktop_config.json。这个文件常见于 MCP 配置或旧版本配置方式,和新版 Claude Desktop 的第三方推理 Gateway 配置不完全相同。为了减少版本差异,优先使用应用内配置界面。
八、常见问题排查
启动后还是走 Claude 官方
优先检查:
| 检查项 | 处理方式 |
|---|---|
| 是否点击 Apply locally | 只填写不应用不会生效 |
| Claude 是否完全退出 | 退出菜单栏、托盘和后台进程后重新打开 |
| Provider 是否为 Gateway | inferenceProvider 必须是 gateway |
| 是否有企业策略覆盖 | MDM 或注册表策略优先级高于本地配置 |
| 地址是否填错 | 不要把 OpenAI 兼容 /v1 地址填到 Gateway base URL |
认证失败
常见原因:
- API Key 填写错误、复制不完整或带了空格。
- API Key 已禁用、删除或过期。
- 账号余额不足。
- API Key 没有 Claude 模型权限。
- Gateway auth scheme 不匹配。AIRouter 通常使用 Bearer 认证,保持默认或填写
bearer。
模型列表为空
Claude Desktop Gateway 模式依赖 Gateway 的模型发现能力。如果界面没有显示模型:
- 先确认 Gateway base URL 是否为
https://aigc.aochengcloud.com/claude。 - 到 AIRouter 控制台确认当前账号可用 Claude 模型。
- 在「Identity & models」中手动添加可用模型 ID。
- 完全退出 Claude Desktop 后重新打开。
请求超时
重点检查链路:
| 检查项 | 说明 |
|---|---|
| 网络访问 | 本机是否能访问 aigc.aochengcloud.com |
| 防火墙/代理 | 公司网络或代理是否拦截 HTTPS 请求 |
| SSL 证书 | 中转站证书是否有效 |
| AIRouter 日志 | 是否有请求进入使用日志 |
| 上游模型状态 | 模型是否正在维护、限流或不可用 |
如果 AIRouter 使用日志没有任何记录,通常说明请求没有到达中转站,需要先排查本机网络、代理或地址配置。
提示配置没有读取
可以在 Claude Desktop 中进入:
Help → Troubleshooting → Copy Managed Configuration Report
这个报告会显示 Claude Desktop 读取到了哪些配置、配置来源以及凭证是否通过校验。敏感值会被隐藏,适合用于定位配置是否生效。
推荐排查顺序
新用户建议按这个顺序处理:
- 确认 AIRouter API Key 可用。
- 确认 Gateway base URL 是
https://aigc.aochengcloud.com/claude。 - 确认没有填写
/v1或尾部/。 - 点击「Apply locally」并完全重启 Claude Desktop。
- 通过 AIRouter「使用日志」判断请求是否成功进入中转站。
这样可以快速区分问题属于本地配置、网络链路,还是账号与模型权限。
参考资料
- 掘金教程:
https://juejin.cn/post/7633755317516107803 - Claude 官方:
https://claude.com/docs/cowork/3p/installation - Claude Gateway 配置:
https://claude.com/docs/cowork/3p/gateway - Claude 配置项参考:
https://claude.com/docs/cowork/3p/configuration