exceeded the 64000/128000 output token maximum - Claude Code
Quick fix
Remove or rewrite the rejected MCP tool JSON Schema pattern to prevent Codex OAuth from falsely reporting an output token limit.
Symptom
Section titled “Symptom”API Error: Claude's response exceeded the 64000/128000 output token maximumThe Codex OAuth backend may reject an MCP tool containing a specific JSON Schema `pattern` before processing the request, then return HTTP 200 with zero input/output tokens, an empty `output`, and `response.incomplete`. This is not actual output truncation.
cc-switch’s Responses→Anthropic converter maps this termination event to `max_tokens`, so Claude Code displays it as an output token limit. Actual output truncation should have non-zero usage; the verified version in this issue was cc-switch v3.20.4.
Check the MCP tool JSON Schema included in the request. Temporarily remove the tool containing a `pattern` regex with nested repeated groups, then retry.
If the tool must remain, replace the verified problematic `^[^/\s]+(?:\/[^/\s]+)+$` with the equivalent flat character class `^[A-Za-z0-9_\-.\/]+$`, then retry the request.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
(No FAQ yet)
Related problems
Section titled “Related problems”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.