Skip to content

Test returns 504: Claude Code unusable

Quick fix

Check whether cc-switch loaded the glm-4.7 model mapping into the proxy; otherwise Claude Code requests glm directly and returns 504.

Error output
测试报504
English translation

Test returns 504

The user configured private model access on Windows, setting `ANTHROPIC_BASE_URL` to `http://10.50.114.37:18994/v1/chat/completions` and mapping `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_MODEL` to `glm-4.7`. Testing with Claude Code returned 504, but the same configuration worked with `ccr`. Comments concluded that this error usually means Claude Code requested the `glm` model directly, indicating cc-switch did not correctly load the model mapping into the proxy. The user later added that both enabling and disabling local proxy mode failed, and the corporate network requires a default proxy, `proxy.公司名.com`, for external access, adding uncertainty to the proxy chain. The issue remains open and has no confirmed fix.

  1. Confirm that the cc-switch proxy configuration actually loads `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_MODEL` to `glm-4.7`, instead of letting Claude Code request the `glm` model directly.

  2. Test with cc-switch local proxy mode both enabled and disabled. If the corporate network forces `proxy.公司名.com`, check whether that enterprise proxy blocks or rewrites `/v1/chat/completions` requests.

  3. Use `ccr` to send a comparison request to the same `ANTHROPIC_BASE_URL` to determine whether the 504 is an upstream configuration issue or a cc-switch model mapping/proxy chain issue.

ToolClaude Code
VersionUnknown
PlatformsWindows
Is local proxy mode enabled?
This was the first troubleshooting direction in the discussion, but the user tested both enabling and disabling local proxy mode and both failed. If the company requires the default proxy `proxy.公司名.com` for external network access, separately check whether that enterprise proxy interferes with the request.

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.