在 CC-Switch 中使用 oairoute
- 多账号、多端点之间一键切换的小工具
- 适合同时持有多个 OAIRoute 账号或在不同网关间对比
- 配置文件格式简单,手写也能用
第一步:获取 API Key
在 OAIRoute 控制台 创建。每个账号建一个,便于区分。
Create one in the OAIRoute console. Create one per account so they're easy to tell apart.
第二步:添加配置
打开 CC-Switch,点 Add,按下表填写一条配置:
配置名称,建议写 OAIRoute-主账号 这样的可辨识名字。
https://api.oairoute.com
该账号的 Key。
默认模型,例如 claude-sonnet-5-5。
Open CC-Switch, click Add, and fill in a configuration per the table below:
A configuration name; something recognizable like OAIRoute-main works well.
https://api.oairoute.com
That account's key.
Default model, e.g. claude-sonnet-5-5.
第三步:切换
在主界面点任意一条配置的 Switch,工具会把该配置写入正在运行的应用(如 Claude Code、Cursor)所读取的位置。
切换的本质是改写环境变量或配置文件。切换后需要重启目标应用,改动才会生效。切换前已开的会话不会跟着变。
On the main screen, click Switch on any configuration. The tool writes that configuration wherever the running app (Claude Code, Cursor, etc.) reads it from.
Switching essentially rewrites environment variables or config files. Restart the target app afterward for the change to take effect. Sessions already open before the switch won't follow.
多配置的用法
| 场景 | 做法 |
|---|---|
| 两个账号轮换,避免单账号限流 | 每条配置一个 Key,被限流时切过去 |
| 对比不同网关的延迟 | 同一模型,不同端点各一条配置 |
| 测试企业 Key 与个人 Key | 分开建配置,标注清楚用途 |
| Scenario | Approach |
|---|---|
| Rotating two accounts to avoid per-account rate limits | One key per configuration; switch over when one is limited |
| Comparing gateway latency | Same model, one configuration per endpoint |
| Testing an enterprise key against a personal key | Separate configurations, clearly labeled |
配置文件位置
CC-Switch 的配置一般存放在用户目录下的隐藏文件夹。具体路径以工具自身说明为准,界面上通常有「Open config folder」入口。
CC-Switch's configuration usually lives in a hidden folder under your user directory. Check the tool's own docs for the exact path; the UI usually offers an "Open config folder" entry.