Skip to content

Commit 19bfe37

Browse files
鲁工鲁工
authored andcommitted
feat: add Qwen3.8 Max, Qwen Token Plan; drop Qwen3.5
Qwen3.8-Max-Preview (model_id qwen3.8-max-preview) is Alibaba's 2.4T flagship preview launched 2026-07-19. Add it as a qwen variant and make it the pay-as-you-go default, so the bare `qwen`/`tongyi` aliases resolve to it; `qwen3.7-max` (`qwen-max`) stays available. Add a separate `qwen-plan` provider for the new 千问 AI 平台 Token Plan subscription. Its sk-sp- keys (from platform.qianwenai.com) hit the same DashScope Anthropic endpoint (dashscope.aliyuncs.com/apps/anthropic, x-api-key) but bill against the subscription instead of pay-as-you-go, so it warrants its own key (QWEN_PLAN_API_KEY) — same pattern as step/step-plan and seed/seed-plan. Endpoint + auth traced to platform.qianwenai.com/docs/api-reference/chat/anthropic. Remove qwen3.5-plus / qwen3.5-flash (and the qwen3.5 alias) per request. Doctor against a real pay-go key: qwen3.7-max [OK]; qwen3.8-max [403 AccessDenied] — the account has not been granted the preview (it is Token-Plan/Qoder-gated at launch), not a routing issue. qwen-plan is unverified upstream (no sk-sp- key on hand).
1 parent 588ee19 commit 19bfe37

8 files changed

Lines changed: 235 additions & 76 deletions

File tree

.env.example

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,17 @@ MINIMAX_API_KEY=eyJhbGciOixxxxxxxxxxxxxxx
4848
MINIMAX_GLOBAL_API_KEY=eyJhbGciOixxxxxxxxxxxxxxx
4949

5050
# ============================================
51-
# Qwen API (阿里云百炼)
51+
# Qwen API (阿里云百炼,按量付费)
5252
# ============================================
5353
# 从 https://dashscope.console.aliyun.com/ 获取
5454
QWEN_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxx
5555

56+
# ============================================
57+
# Qwen Token Plan (千问 AI 平台订阅)
58+
# ============================================
59+
# 从 https://platform.qianwenai.com/ 获取 sk-sp- 订阅 Key(与按量付费同一 Anthropic 端点,按订阅额度计费)
60+
QWEN_PLAN_API_KEY=sk-sp-xxxxxxxxxxxxxxxxxxxxx
61+
5662
# ============================================
5763
# GLM CN API (智谱 AI 国内版)
5864
# ============================================

README.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,10 @@ ccmr claude --print --output-format json "你的问题"
197197
| `kimi-plan-for-coding-highspeed` | `kimi-plan-highspeed` | Kimi K2.7 Code HighSpeed(Allegretto 及以上) | Kimi Code 会员订阅 |
198198
| `minimax-m3` | `minimax`, `minimax-cn`, `mm` | MiniMax M3 | MiniMax CN |
199199
| `minimax-global-m3` | `minimax-global`, `minimax-io` | MiniMax M3 | MiniMax Global |
200-
| `qwen3.5-plus` | `qwen`, `qwen3.5`, `tongyi` | Qwen3.5 Plus | 阿里云 |
201-
| `qwen3.5-flash` | - | Qwen3.5 Flash | 阿里云 |
202-
| `qwen3.7-max` | `qwen-max`, `qwen3.7` | Qwen3.7 Max | 阿里云 |
200+
| `qwen3.8-max` | `qwen`, `qwen3.8`, `tongyi` | Qwen3.8 Max (Preview) | 阿里云(按量付费) |
201+
| `qwen3.7-max` | `qwen-max`, `qwen3.7` | Qwen3.7 Max | 阿里云(按量付费) |
202+
| `qwen-plan-3.8-max` | `qwen-plan`, `qwen-plan-3.8`, `qwen-plan-max` | Qwen3.8 Max (Preview) | 千问 Token Plan(订阅) |
203+
| `qwen-plan-3.7-max` | `qwen-plan-3.7` | Qwen3.7 Max | 千问 Token Plan(订阅) |
203204
| `glm-5.2` | `glm`, `zhipu`, `chatglm` | GLM-5.2 | 智谱 AI(国内) |
204205
| `glm-5.1` | `glm-5` | GLM-5.1 | 智谱 AI(国内) |
205206
| `glm-global-5.2` | `glm-global`, `zai`, `z-ai` | GLM-5.2 | Z.ai(国际) |
@@ -228,9 +229,8 @@ ccmr claude --print --output-format json "你的问题"
228229
| Kimi K3 (Coding Plan `kimi-plan-k3-1m` / `kimi-plan-k3`) | 1M / 256K(按档位) | 1M / 128K |
229230
| Kimi K2.7 Code / HighSpeed (Coding Plan) | 256K | 32K |
230231
| MiniMax M3 (CN / Global) | 1M | 128K |
231-
| Qwen3.5 Plus | 1M | 64K |
232-
| Qwen3.5 Flash | 1M | 64K |
233-
| Qwen3.7 Max | 1M | 64K |
232+
| Qwen3.8 Max Preview (按量付费 / Token Plan) | 1M | 64K |
233+
| Qwen3.7 Max (按量付费 / Token Plan) | 1M | 64K |
234234
| GLM-5.2 (国内 / 国际) | 1M | 128K |
235235
| GLM-5.1 (国内 / 国际) | 200K | 128K |
236236
| Step 3.7 Flash (按量付费 / Step Plan) | 256K | 384K |
@@ -248,7 +248,7 @@ Claude Code 内置的 `Web Search` 是 **Anthropic 服务端工具**(`web_sear
248248
| DeepSeek | ✅ 支持 | 同上 |
249249
| MiniMax CN(minimax-m3) | ✅ 支持 | 同上 |
250250
| 智谱 GLM(glm-5.2) | ❌ 不支持 | 工具被静默忽略,模型回答"无法联网",Claude Code 显示 `Did 0 searches` |
251-
| Qwen(qwen3.5-plus| ❌ 不支持 | 同上 |
251+
| Qwen 按量付费(qwen3.7-max| ❌ 不支持 | 同上 |
252252

253253
其余供应商(Kimi 国际站、GLM Global、Step、MiMo、Doubao Seed、MiniMax Global)未实测,以实际行为为准;供应商随时可能补齐支持。
254254

@@ -271,7 +271,8 @@ KIMI_CN_API_KEY=sk-xxx # Kimi 国内开放平台(与国际站不互通):
271271
KIMI_CODE_API_KEY=sk-xxx # Kimi Code 会员 coding 订阅(与开放平台不互通): https://www.kimi.com/code/console
272272
MINIMAX_API_KEY=xxx # MiniMax CN / Token Plan: https://platform.minimaxi.com/
273273
MINIMAX_GLOBAL_API_KEY=xxx # MiniMax Global: https://platform.minimax.io/
274-
QWEN_API_KEY=sk-xxx # https://dashscope.console.aliyun.com/
274+
QWEN_API_KEY=sk-xxx # Qwen 按量付费: https://dashscope.console.aliyun.com/
275+
QWEN_PLAN_API_KEY=sk-sp-xxx # Qwen Token Plan 订阅(与按量付费同一端点): https://platform.qianwenai.com/
275276
GLM_API_KEY=xxx # GLM 国内版(智谱): https://open.bigmodel.cn/
276277
GLM_GLOBAL_API_KEY=xxx # GLM 国际版(Z.ai): https://z.ai/model-api
277278
ARK_API_KEY=xxx # Doubao Seed 火山方舟 按量付费 (/api/compatible): https://console.volcengine.com/ark
@@ -381,7 +382,7 @@ claude
381382
```bash
382383
npx claude-code-model-router claude
383384
```
384-
- 使用第三方 AI 模型(DeepSeek V4, GLM-5.2, Qwen3.7, Kimi K2.6, Doubao Seed 2.1, MiMo V2.5 等)
385+
- 使用第三方 AI 模型(DeepSeek V4, GLM-5.2, Qwen3.8, Kimi K3, Doubao Seed 2.1, MiMo V2.5 等)
385386
- 按 API 使用量付费
386387
- 配置存储在 `~/.claude-gateway/`
387388

@@ -406,8 +407,9 @@ npx claude-code-model-router claude
406407
```bash
407408
# 使用短名称(向后兼容)
408409
/model deepseek # 切换到 DeepSeek V4 Pro
409-
/model qwen # 切换到 Qwen3.5 Plus
410-
/model qwen-max # 切换到 Qwen3.7 Max
410+
/model qwen # 切换到 Qwen3.8 Max Preview(按量付费)
411+
/model qwen-max # 切换到 Qwen3.7 Max(按量付费)
412+
/model qwen-plan # 切换到 Qwen3.8 Max Preview(千问 Token Plan 订阅)
411413
/model glm # 切换到 GLM-5.2(国内 智谱)
412414
/model glm-global # 切换到 GLM-5.2(国际 Z.ai)
413415
/model seed # 切换到 Doubao Seed 2.1 Pro(火山方舟 按量付费)
@@ -437,9 +439,10 @@ npx claude-code-model-router claude
437439
/model kimi-k2.6 # Kimi K2.6
438440
/model kimi-k2.7-code # Kimi K2.7 Code
439441
/model kimi-k2.7-code-highspeed # Kimi K2.7 Code HighSpeed
440-
/model qwen3.5-plus # Qwen3.5 Plus
441-
/model qwen3.5-flash # Qwen3.5 Flash
442-
/model qwen3.7-max # Qwen3.7 Max
442+
/model qwen3.8-max # Qwen3.8 Max Preview(按量付费)
443+
/model qwen3.7-max # Qwen3.7 Max(按量付费)
444+
/model qwen-plan-3.8-max # Qwen3.8 Max Preview(Token Plan 订阅)
445+
/model qwen-plan-3.7-max # Qwen3.7 Max(Token Plan 订阅)
443446
/model seed-2.1-pro # Doubao Seed 2.1 Pro(按量付费)
444447
/model seed-2.1-turbo # Doubao Seed 2.1 Turbo(按量付费)
445448
/model seed-plan-2.1-pro # Doubao Seed 2.1 Pro(Agent Plan 订阅)
@@ -527,6 +530,12 @@ DeepSeek Anthropic 兼容接口会忽略 `metadata` 字段,但某些 Claude Co
527530

528531
## 更新日志
529532

533+
### v1.11.0
534+
535+
- 新增 **Qwen3.8 Max Preview**`qwen3.8-max`,模型 ID `qwen3.8-max-preview`,阿里 2026-07-19 发布的 2.4T 旗舰预览版):按量付费 `qwen` provider 的默认模型,裸别名 `qwen` / `tongyi` 现指向它;`qwen3.7-max`(别名 `qwen-max` / `qwen3.7`)保留
536+
- 新增 **Qwen Token Plan 订阅** provider(`qwen-plan-3.8-max`,别名 `qwen-plan`):Key 来自 [千问 AI 平台](https://platform.qianwenai.com/)`sk-sp-` 订阅密钥,需配置 `QWEN_PLAN_API_KEY`;走 DashScope 同一 Anthropic 兼容端点(`dashscope.aliyuncs.com/apps/anthropic`),但按订阅额度计费,另含 `qwen-plan-3.7-max`
537+
- 移除 **Qwen3.5 Plus / Qwen3.5 Flash**`qwen3.5-plus``qwen3.5-flash` 及别名 `qwen3.5` 下线)
538+
530539
### v1.10.0
531540

532541
- 新增 Kimi Code 会员 coding 订阅入口(`api.kimi.com/coding`,Key 来自 [kimi.com 会员控制台](https://www.kimi.com/code/console),与开放平台不互通):需配置 `KIMI_CODE_API_KEY`,提供 `kimi-plan-k3-1m`(别名 `kimi-plan`,Allegretto 及以上)、`kimi-plan-k3`(Moderato 及以上,256K)、`kimi-plan-for-coding`(别名 `kimi-for-coding`,全档位)、`kimi-plan-for-coding-highspeed`;模型与上下文按会员档位限权

dist/config.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/config.js

Lines changed: 81 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/config.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "claude-code-model-router",
3-
"version": "1.10.0",
3+
"version": "1.11.0",
44
"description": "A lightweight API gateway for routing Claude Code requests to multiple AI models",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)