Skip to content

Configuring Claude Code in CC Switch ​

This guide walks you through adding RKAPI as a Claude Code provider in CC Switch, verifying the generated ~/.claude/settings.json file, and confirming live requests in your terminal.

Prerequisites ​

Step 1: Add an RKAPI Provider for Claude Code ​

  1. Launch CC Switch and select the Claude Code tab in the top navigation bar.
  2. Click Add Provider (+) and choose Custom (or the Anthropic-compatible template).
  3. Enter the following settings:
FieldValueNotes
Provider NameRKAPIOr a specific label such as RKAPI - Claude
API Base URL (ANTHROPIC_BASE_URL)https://api.zwwbai.comDo NOT add /v1 at the end
API Key (ANTHROPIC_AUTH_TOKEN)sk-your-api-keyPaste your full API key from RKAPI
Default Model (ANTHROPIC_MODEL)claude-sonnet-4-6Check active model IDs at https://s2pbxm0xv5y.adtyai-fz.top/pricing
Fast / Small Model (ANTHROPIC_SMALL_FAST_MODEL)claude-haiku-4-5-20251001Optional; used for quick background tasks

Never Append /v1 to the Claude Base URL

Claude Code automatically appends /v1/messages to ANTHROPIC_BASE_URL. Setting the URL to https://api.zwwbai.com/v1 produces /v1/v1/messages and fails with HTTP 404. Always use https://api.zwwbai.com.

Step 2: Review the Generated settings.json ​

CC Switch provides a JSON preview editor before saving. Your RKAPI Claude Code profile should render cleanly to a configuration equivalent to the following:

json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.zwwbai.com",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-api-key",
    "ANTHROPIC_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4-5-20251001",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

When activated, CC Switch writes this JSON to Claude Code's user configuration path:

  • macOS / Linux: ~/.claude/settings.json
  • Windows: %USERPROFILE%\.claude\settings.json

Optional Model Overrides

You can leave ANTHROPIC_MODEL and ANTHROPIC_SMALL_FAST_MODEL unset if you prefer switching models interactively inside Claude Code using /model, or pin specific model IDs per CC Switch profile (for example, one profile pinned to claude-opus-4-6 for architecture reviews and another pinned to claude-sonnet-4-6 for daily coding).

Step 3: Activate the Profile ​

  1. Click Save to store the RKAPI provider in CC Switch.
  2. Click Enable / Switch on the RKAPI card so it becomes the active Claude Code provider.
  3. Confirm the file on disk was updated:

macOS / Linux:

bash
cat ~/.claude/settings.json

Windows PowerShell:

powershell
Get-Content "$env:USERPROFILE\.claude\settings.json"

Step 4: Test in Your Terminal ​

Open a new terminal window inside any project directory and start Claude Code:

bash
claude

Inside the interactive session:

  1. Run /status to verify Claude Code sees https://api.zwwbai.com as its API base URL and reports no authentication warnings.
  2. Send a short test prompt (for example: Reply with OK and the model you are running.).
  3. Visit https://s2pbxm0xv5y.adtyai-fz.top/usage-logs to confirm the request logged under your API key with token usage details.

Switching Between Multiple Profiles ​

If you maintain separate RKAPI profiles (such as personal vs. team keys or different channel groups):

  1. Click the target profile in CC Switch's Claude Code tab.
  2. Exit any running claude session (/exit) and relaunch claude so the process loads the updated ~/.claude/settings.json.

Troubleshooting & Further Optimization ​

  • Claude Code still prompts for an Anthropic account login: Check whether stale ANTHROPIC_API_KEY or ANTHROPIC_BASE_URL environment variables exist in your shell, or verify ~/.claude.json onboarding state. See Claude Code FAQ.
  • HTTP 403 error: You likely entered https://s2pbxm0xv5y.adtyai-fz.top instead of https://api.zwwbai.com.
  • HTTP 404 error: Check that ANTHROPIC_BASE_URL does not end with /v1.
  • Low prompt cache hit rate: Review Claude Code Cache Fix to maximize prompt caching efficiency on long coding sessions.
  • Want to route ChatGPT or DeepSeek models through Claude Code? See ChatGPT via Claude Code and DeepSeek via Claude Code.