外观
CC Switch
CC Switch 可以管理和切换 Claude Code、Codex、OpenClaw 与 Hermes Agent 的 Provider。为每个客户端和 Provider 创建独立 API Key。
客户端与使用方案
| 客户端 | API Key 使用方案 | 说明 |
|---|---|---|
| Claude Code CLI / Claude App | claude-code-subscription | 使用 Anthropic Messages 协议 |
| Codex App / CLI | codex-subscription | 使用 OpenAI Responses 协议 |
| OpenClaw / Hermes Agent | agent-subscription-payg-fallback 或 agent-subscription | 必须由对应的标准 Harness 发起请求 |
CC Switch 负责写入和切换 Provider 配置,不会把普通脚本或自定义 Harness 转换成受支持的标准 Agent 客户端。
Claude Code Provider
| 字段 | 值 |
|---|---|
| Provider 类型 | Claude / Anthropic |
| Base URL | https://agent-team-api.myrimate.cn |
| API Key | 选择了 claude-code-subscription 的 LLM GATEWAY Key |
| 默认模型 | 从模型广场的 Claude Code 订阅中选择 |
Base URL 不带 /v1,最终请求应发送到 /v1/messages。
Codex Provider
| 字段 | 值 |
|---|---|
| Provider 类型 | Codex / OpenAI Responses |
| Base URL | https://agent-team-api.myrimate.cn/v1 |
| API Key | 选择了 codex-subscription 的 LLM GATEWAY Key |
| 默认模型 | 从模型广场的 Codex 订阅中选择 |
Codex Provider 必须使用 Responses 协议。最终请求应发送到 /v1/responses。
OpenClaw / Hermes Agent Provider
在 CC Switch 中为 OpenClaw 或 Hermes Agent 配置 Provider 时,使用单独的 LLM GATEWAY Key。需要按量兜底时选择 agent-subscription-payg-fallback;明确不允许进入 PAYG 时选择 agent-subscription。
模型名称必须与模型广场在对应使用方案下展示的名称一致。Base URL 和协议按照 CC Switch 中该客户端的 Provider 模板填写。
不要混用不同方案的 Key
Claude Code、Codex 和 Agent Key 的使用方案、协议与适用额度不同。即使 CC Switch 可以保存多个 Provider,也应分别创建 LLM GATEWAY Key:
text
ccswitch-claude → claude-code-subscription
ccswitch-codex → codex-subscription
ccswitch-agent → agent-subscription-payg-fallback1
2
3
2
3
排查代理错误
CC Switch 报错中通常同时包含:
- 本地代理返回状态。
- LLM GATEWAY 返回状态。
- 模型名、接口和 request id。
排查时保留完整错误文本,但应遮盖 API Key。若错误中显示 /responses 而不是 /v1/responses,优先修正 Codex Provider 的 Base URL;若显示 /v1/v1/messages,优先修正 Claude Provider 的 Base URL。
