Skip to content

Integration guide

CC Switch One-Click Provider Import (ccswitch://) for Claude Code, Codex & OpenCode

Import ProxyStacks Relay into CC Switch (v4.0.10+) in one click via the official ccswitch://v1/import deep-link protocol. Preloads both Global and Hong Kong CN2 endpoints for built-in latency testing and instant failover whenever Claude Pro/Max hits a 5-hour limit or HTTP 529.

One-Click Import into CC Switch (v4.0.10+)

Generates official ccswitch://v1/import deep links with both Global and Hong Kong endpoints preloaded for built-in latency speed testing.

Global + HK dual endpoints included
Primary endpoint order

Assembled 100% locally in your browser (never sent over the network). Leave blank to import a placeholder key and edit inside CC Switch.

Claude Codeanthropic

model: claude-sonnet-5-5

Codex CLIopenai_responses

model: gpt-6.1-sol

OpenCodeopenai_chat

model: claude-sonnet-5-5

Requires CC Switch desktop app installed: Download CC Switch on GitHub

Setup

  1. 1

    Paste your sk-relay-... key into the local generator above (or leave blank to edit inside CC Switch after import) and pick Global or HK CN2 as your primary endpoint.

  2. 2

    Click the Import to CC Switch button for Claude Code (apiFormat=anthropic), Codex CLI (apiFormat=openai_responses), or OpenCode (apiFormat=openai_chat) one at a time and confirm in the CC Switch dialog.

  3. 3

    Open API Endpoint Management on the imported card inside CC Switch to speed-test Global vs HK endpoints, and toggle between your subscription and Relay in 1 click.

Configuration

deepseek-v4.1-flash
ccswitch://v1/import (1-Click Deep Link)
# Official CC Switch v4.0.10+ Deep Links (comma-separated dual endpoints for speed test)
# 1. Claude Code (native Anthropic Messages, zero local format-routing needed):
ccswitch://v1/import?resource=provider&app=claude&name=ProxyStacks+Relay&endpoint=https%3A%2F%2Fproxystacks.com%2Fanthropic%2Chttps%3A%2F%2Fhk.proxystacks.com%2Fanthropic&apiKey=sk-relay-your-key&apiFormat=anthropic&model=deepseek-v4.1-flash&opusModel=claude-opus-5-5&sonnetModel=claude-sonnet-5-5&haikuModel=claude-haiku-5-5&homepage=https%3A%2F%2Fproxystacks.com

# 2. Codex CLI (native OpenAI Responses API):
ccswitch://v1/import?resource=provider&app=codex&name=ProxyStacks+Relay&endpoint=https%3A%2F%2Fproxystacks.com%2Fv1%2Chttps%3A%2F%2Fhk.proxystacks.com%2Fv1&apiKey=sk-relay-your-key&apiFormat=openai_responses&model=gpt-6.1-sol&homepage=https%3A%2F%2Fproxystacks.com

One-click ccswitch://v1/import deep links for Claude Code (/anthropic), Codex (/v1), and OpenCode with Global + HK CN2 dual-endpoint speed testing.

Advanced config: environment variable API key, multi-model routing & max output tokens

Use a project-specific config or multi-profile setup with environment variable keys, flagship and fast models — Claude Opus/Sonnet 5.5 (-50%), GPT-6.1 Sol / GPT-6 Luna (-30%), DeepSeek V4.1 Flash (-40%), GLM-5.3 & Kimi K3.1 Pro (-30%) — and explicit context/output token limits.

CC Switch Provider Card (Global + HK)
{
  // Manual Provider Card Setup in CC Switch (Claude Code / Codex / OpenCode)
  // Tip: Add both Global and HK CN2 endpoints under "API Endpoint Management" to run built-in latency speed tests
  "claudeCodeProvider": {
    "name": "ProxyStacks Relay",
    "apiFormat": "anthropic",
    "endpoints": [
      "https://proxystacks.com/anthropic",
      "https://hk.proxystacks.com/anthropic"
    ],
    "apiKey": "sk-relay-your-key",
    "models": {
      "opusModel": "claude-opus-5-5",
      "sonnetModel": "claude-sonnet-5-5",
      "haikuModel": "claude-haiku-5-5",
      "smallFastModel": "deepseek-v4.1-flash"
    }
  },
  "codexProvider": {
    "name": "ProxyStacks Relay",
    "apiFormat": "openai_responses",
    "endpoints": [
      "https://proxystacks.com/v1",
      "https://hk.proxystacks.com/v1"
    ],
    "apiKey": "sk-relay-your-key",
    "model": "gpt-6.1-sol"
  }
}

Troubleshooting

  • 401: check the Relay key and authentication header. Never paste a secret into a support ticket.
  • 404: use an exact published model ID and the documented base URL, not an upstream alias.
  • For streaming use stream: true. Codex uses Responses; keep disable_response_storage = true.

Common questions

Why does CC Switch avoid the 'Needs routing' badge with ProxyStacks Relay?

CC Switch marks third-party providers as 'Needs routing' only when their protocol differs from the client's native format. Because ProxyStacks Relay natively speaks Anthropic Messages (/anthropic) for Claude Code and OpenAI Responses (/v1) for Codex CLI, both import cards run natively with zero local format-conversion proxy required.

How does comma-separated dual-endpoint speed testing work in ccswitch://v1/import?

Passing both https://proxystacks.com/anthropic and https://hk.proxystacks.com/anthropic separated by a comma in the endpoint parameter sets the first URL as primary and registers the second inside CC Switch's API Endpoint Management list, so you can benchmark latency and fail over in one click.

Why must I click Claude Code, Codex, and OpenCode import buttons one by one?

Per the CC Switch v4.0.10+ deep-link specification, the desktop app processes one pending ccswitch:// confirmation modal at a time (a second click before confirming replaces the previous modal) and requires a non-empty apiKey field on provider links.

All docs