CC Switch:快速配置与用量查询
用 CC Switch 导入 GetToken 配置、切换 provider,并查询账户用量。
导入 GetToken 配置
- 安装并打开 CC Switch。
- 进入 GetToken 控制台的「API Key」页面。
- 找到要使用的 Key,点击「CC Switch」并确认导入。
导入内容包括服务地址、默认模型和当前 API Key。浏览器会尝试打开 ccswitch:// 链接。
下载与安装
GetToken 提供 macOS 和 Windows 加速下载,也可以从官方发布页获取客户端:
需要命令行版本时运行:
curl -fsSL 'https://gettoken.dev/api/downloads/cc-switch?target=cli&platform=install' | bash配置用量查询
在 CC Switch 的 GetToken provider 卡片中打开「用量查询」,填写:
| 字段 | 填写内容 |
|---|---|
| API Key | 你的 GetToken API Key |
| 请求地址 / Base URL | https://api.gettoken.dev |
| 超时时间 | 10 |
| 自动查询间隔 | 5;不自动刷新可填 0 |
提取器代码:
({
request: {
url: "{{baseUrl}}/v1/user/balance",
method: "GET",
headers: {
"Authorization": "Bearer {{apiKey}}",
"User-Agent": "cc-switch/1.0"
}
},
extractor: function(response) {
return {
isValid: response.isValid,
invalidMessage: response.invalidMessage,
remaining: response.remaining,
unit: response.unit,
planName: response.planName,
total: response.total,
used: response.used,
extra: response.extra
};
}
})测试脚本成功后保存配置,再回到 provider 卡片启用用量查询。
遇到问题
- 返回 404:确认地址是
https://api.gettoken.dev,路径是/v1/user/balance。 - Key 无效:检查复制内容和 Key 状态。
- 余额或额度耗尽:回到控制台查看账户余额与用量窗口。