'max_tokens' is not supported with this model
启动claude-code的命令:
export ANTHROPIC_BASE_URL=http://localhost:4141 ANTHROPIC_AUTH_TOKEN=dummy ANTHROPIC_MODEL=gpt-5.3-codex ANTHROPIC_DEFAULT_SONNET_MODEL=gpt-5.3-codex ANTHROPIC_SMALL_FAST_MODEL=gpt-5.4-mini ANTHROPIC_DEFAULT_HAIKU_MODEL=gpt-5.4-mini DISABLE_NON_ESSENTIAL_MODEL_CALLS=1 CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 && claude
报错信息 HTTP error: { error: 1:13:39 AM { message: "Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.", code: 'invalid_request_body' } }
有解决这个问题?
so do I :(
You can use this with the latest release:
npx betahi-copilot-api@latest start
Then either:
- pass the model explicitly:
claude --model gpt-5.3-codexclaude --model gpt-5.4claude --model gpt-5.4-mini
- or configure
~/.claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:4141",
"ANTHROPIC_AUTH_TOKEN": "dummy",
"ANTHROPIC_MODEL": "gpt-5.3-codex",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.3-codex",
"ANTHROPIC_SMALL_FAST_MODEL": "gpt-5.4-mini",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5.4-mini",
"COPILOT_REASONING_EFFORT": "medium",
"DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}
Supported reasoning effort:
- gpt-5.4:
low, medium, high, xhigh - gpt-5.3-codex:
low, medium, high, xhigh - gpt-5.4-mini:
none, low, medium
More details: https://github.com/betaHi/copilot-api?tab=readme-ov-file#gpt-support
我是自己修改代码解决的,https://github.com/ericc-ch/copilot-api/pull/234