Skip to content

请求转发失败: 上游请求失败: client error (Connect) - Claude Code

Quick fix

Temporarily bypass the CC Switch local proxy or switch networks to check whether DeepSeek is blocked. No final fix has been confirmed.

Error output
{"error":{"message":"请求转发失败: 上游请求失败: client error (Connect)","type":"proxy_error"}}
English translation

{"error":{"message":"Request forwarding failed: Upstream request failed: client error (Connect)","type":"proxy_error"}}

When CC Switch 3.20.4 forwards Claude Code requests to DeepSeek through the local proxy 127.0.0.1:15721 on macOS, upstream requests alternate between client error (Connect) and client error (SendRequest), and the forwarding layer returns HTTP 502. Using the same Key, model, and request body to connect directly to the upstream service returns HTTP 200, showing that this report's failure occurs in the local proxy forwarding path rather than in the request itself.

The problem persisted after the reporter disabled Shadowrocket TUN, restored the system proxy settings, restarted CC Switch, and confirmed that DNS worked normally. A comment suggested that the current network might block DeepSeek and recommended switching networks, but no successful result was reported. The issue remains open, so neither the root cause nor a final fix has been confirmed.

  1. Temporarily bypass the CC Switch local proxy and request the DeepSeek upstream service directly. The reporter confirmed that the same Key, model, and request body returned HTTP 200 when sent directly to https://api.deepseek.com/anthropic/v1/messages.

  2. Switch networks and test again to determine whether the current network blocks DeepSeek. This was suggested in an issue comment, but no user has confirmed that it works.

  3. Do not treat disabling the system proxy or restarting CC Switch as confirmed fixes. The problem persisted after the reporter performed these actions.

ToolClaude Code
Version受影响版本:3.20.4
PlatformsmacOS
How can I resolve the 502 error?
There is currently no confirmed final fix. You can temporarily bypass the CC Switch local proxy and connect directly to DeepSeek, or switch networks to check whether DeepSeek is blocked. Disabling the system proxy and restarting CC Switch did not help in this report.

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.