Skip to content

Upstream request failed - CC Switch

Quick fix

Check if the upstream provider supports the current model or has regional restrictions; switch to an available model.

Error output
Failed to authenticate. API Error: 403 Upstream request failed: [403] This model is not available in your region.

This error is usually caused by an HTTP 403 status code returned by the upstream provider, specifically "This model is not available in your region". This indicates that the configured model is denied access by the upstream service due to network environment or account permissions.

In some scenarios (e.g., Issue #3750), when using Claude Desktop proxy mode with `apiFormat: anthropic`, if the request body contains a `role: "system"` message within the `messages` array, certain strict Anthropic-compatible backends (such as sub2api antigravity) will reject this format and return "Upstream request failed" or HTTP 400 INVALID_ARGUMENT. Although the error text differs slightly, the core mechanism is upstream rejection of request format or model availability. For 403 errors, prioritize confirming model availability; for 400 errors involving system messages, refer to the normalization fix suggestions in Issue #3750.

  1. Confirm the list of models supported by the upstream provider. Try switching the model in the configuration to another known available model (such as DeepSeek series) to verify if it is a specific model's regional restriction issue.

    ~/.cc-switch/settings.json
    {
    "providers": [
    {
    "id": "your-provider-id",
    "model": "deepseek-chat"
    }
    ]
    }
  2. If using Claude Desktop proxy mode and encountering a 400 error (not 403), ensure CC Switch version >= 3.16.1 and check if the system message normalization logic has been applied. If not handled automatically, manually modify the request forwarding logic or upgrade to a version containing the fix.

ToolClaude Code / Claude Desktop
Version3.16.1 - 3.19.2
PlatformsWindowsmacOS
Why does the connection test succeed but sending messages fail?
The connection test may only send minimal requests without system messages or specific model parameters. In actual use, Claude Desktop sends requests containing system instructions. If the upstream backend strictly validates the messages[].role=system format or enforces model regional restrictions, it triggers "Upstream request failed".
How to distinguish between model unavailability and request format errors?
Check the full error message: if it contains "[403] This model is not available in your region", it is a model/regional issue; if it contains "HTTP 400" and "INVALID_ARGUMENT" and involves system messages, it is a request format issue.

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.