Skip to content

Unsupported parameter: 'max_tokens' - Claude Code

Quick fix

The route forwards max_tokens to a model that only accepts max_completion_tokens. Verify parameter support or wait for a cc-switch fix.

Error output
API Error: 400 Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.

On Windows, the user switched Claude Code to a GPT model through cc-switch 3.15.0 and enabled routing. The Claude Code request includes `max_tokens`, but the target model or upstream API does not accept that parameter and only accepts `max_completion_tokens`, so it returns 400: `Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.` The maintainer asked for a reproducible configuration, but no further details were provided. The fixed version and exact configuration change therefore remain unknown.

  1. The issue was closed without a confirmed fix. Reproduce it through the cc-switch route and check whether the selected model supports `max_tokens`. The error says the model requires `max_completion_tokens`, but cc-switch does not replace the field while forwarding. Wait for a cc-switch fix or adjust the upstream configuration manually; issue #3042 does not document a manual procedure.

ToolClaude Code
Version3.15.0(受影响版本;修复版本未知)
PlatformsWindows

This page is distilled from 1 real issues

(No FAQ yet)

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.