ClaudeCode桌面版接入第三方模型有原生图形化配置与cc-switch工具两种方案,均需服务商API兼容Anthropic消息接口。原生配置适合固定模型,cc-switch便于多服务商切换。配置时需正确填写网关地址、密钥及模型ID,并注意接口兼容性限制。
聊到Claude Code接入第三方模型,其实不外乎两种主流方案:软件内原生图形化配置(官方自带,不需要额外工具),以及cc-switch可视化多模型管理工具(适合频繁切换多服务商)。两种方案都要求目标API兼容Anthropic/Claude的消息接口(/v1/messages、流式输出、工具调用)。下面挨个说清楚。

长期稳定更新的攒劲资源: >>>点此立即查看<<<
Help → TroubleshootingEnable Developer Mode,确认弹窗,完全重启软件Developer 菜单点击顶部:Developer → Configure Third-Party Inference
Connection选择 Gateway(默认),按服务商填入:
| 配置项 | 说明&示例 |
|---|---|
| Gateway base URL | 服务商兼容Claude的接口地址 OpenRouter: https://openrouter.ai/apiDeepSeek: https://api.deepseek.com/anthropicOllama本地: http://127.0.0.1:11434/v1阿里云通义千问: https://dashscope.aliyuncs.com/apps/anthropic |
| Gateway API key | 服务商后台生成的sk密钥 |
| Gateway auth scheme | 绝大多数填 bearer;OpenRouter填 x-api-key |
| Gateway extra headers | 无特殊需求留空 |
如果网关无法自动拉取 /v1/models,在下方 Model list 手动填入模型ID:
gpt-4o-mini、qwen3.6-coder、deepseek-v3deepseek-chat、deepseek-coder-v2codellama:70b-code、qwen2.5-coder:32bApply locally(仅本机生效)Relaunch now 重启软件配置第三方网关后,登录界面直接选择 Start in Cowork on 3 P,不需要登录Anthropic账号。
cc-switch是第三方管理工具,内置几十家模型服务商预设,一键切换API地址与密钥,不用反复改原生配置。

GitHub Releases下载对应系统安装包:github.com/farion1231/cc-switch/releases
Claude 标签+ 添加供应商API Key
https://openrouter.ai/apix-api-keysk-or-v1-xxxanthropic/claude-3.5-sonnet、openai/gpt-4o、qwen/qwen3.6-coderhttps://api.deepseek.com/anthropicbearersk-xxxdeepseek-coder-v2、deepseek-chathttp://127.0.0.1:11434/v1bearer(无密钥随便填一串字符)qwen2.5-coder:14b、codellama:34b/v1/messages 流式接口,仅OpenAI兼容/chat/completions无法直接用,需要中转网关。/v1,少写会请求失败;侠游戏发布此文仅为了传递信息,不代表侠游戏网站认同其观点或证实其描述