Unsupported parameter: 'max_tokens' - Claude Code
Quick fix
报错来自路由转发时携带了模型不支持的 max_tokens 参数;issue 中未给出已确认的修复步骤,请核对模型参数支持或等待 cc-switch 修复。
Symptom
Section titled “Symptom”API Error: 400 Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.用户在 Windows 上使用 cc-switch 3.15.0 将 Claude Code 切换到 GPT 模型,并开启路由。Claude Code 发出的请求携带了 `max_tokens`,但目标模型或上游接口不接受该参数,只接受 `max_completion_tokens`,因此返回 400:`Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.`。issue 中维护者要求提供可复现的配置,但后续没有补充信息;因此无法确认修复版本或具体配置变更。
该 issue 已关闭但未记录已确认的修复步骤;请在 cc-switch 路由配置中复现并核对所用模型是否支持 `max_tokens`。根据报错提示,该模型要求使用 `max_completion_tokens`,而 cc-switch 转发时未自动替换该字段,需等待 cc-switch 修复或手动调整上游配置(issue #3042 未记录手动调整方法)。
Affected Versions
Section titled “Affected Versions”ToolClaude Code
Version3.15.0(受影响版本;修复版本未知)
PlatformsWindows
Source Issues
Section titled “Source Issues”本页汇总自 1 个真实 issue
(暂无 FAQ)
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。