Skip to content

Deploy Claude Code

Configure Claude Code to use 3xCoder as its API endpoint.

Prerequisites

  • Node.js installed (v18+)
  • A 3xCoder API key
  • Claude Code installed (npm install -g @anthropic-ai/claude-code)

CC-Switch is a graphical tool that makes configuring Claude Code easy.

  1. Install CC-Switch:
bash
npx cc-switch@latest
  1. In the CC-Switch interface:

    • Select 3xCoder as the provider (or add a custom provider)
    • Set the Base URL: https://api.3xcoder.com
    • Enter your API Key
    • Click Apply
  2. Launch Claude Code — it will automatically use the 3xCoder endpoint.

Method 2: Skip Onboarding + Manual Config

Step 1: Skip the Onboarding

If Claude Code prompts you to authenticate with Anthropic, skip it:

powershell
$env:DISABLE_AUTOUPDATER = 1
$env:DISABLE_ERROR_REPORTING = 1
claude
bash
DISABLE_AUTOUPDATER=1 DISABLE_ERROR_REPORTING=1 claude

When prompted to log in, press Esc or Ctrl+C to skip.

Step 2: Configure the API Endpoint

Windows

Edit %APPDATA%\Claude\settings.json (create it if it doesn't exist):

json
{
  "apiBaseUrl": "https://api.3xcoder.com",
  "apiKey": "sk-your-api-key-here"
}

Or set environment variables in your PowerShell profile ($PROFILE):

powershell
$env:ANTHROPIC_BASE_URL = "https://api.3xcoder.com"
$env:ANTHROPIC_API_KEY = "sk-your-api-key-here"

macOS

Edit ~/Library/Application Support/Claude/settings.json:

json
{
  "apiBaseUrl": "https://api.3xcoder.com",
  "apiKey": "sk-your-api-key-here"
}

Or add to ~/.zshrc:

bash
export ANTHROPIC_BASE_URL="https://api.3xcoder.com"
export ANTHROPIC_API_KEY="sk-your-api-key-here"

Linux

Edit ~/.config/Claude/settings.json:

json
{
  "apiBaseUrl": "https://api.3xcoder.com",
  "apiKey": "sk-your-api-key-here"
}

Or add to ~/.bashrc:

bash
export ANTHROPIC_BASE_URL="https://api.3xcoder.com"
export ANTHROPIC_API_KEY="sk-your-api-key-here"

Step 3: Verify

Run Claude Code:

bash
claude

If configured correctly, Claude Code will connect through the 3xCoder relay.

Method 3: Environment Variables Only

You can set environment variables for a single session without modifying config files:

powershell
$env:ANTHROPIC_BASE_URL = "https://api.3xcoder.com"
$env:ANTHROPIC_API_KEY = "sk-your-api-key-here"
claude
bash
ANTHROPIC_BASE_URL="https://api.3xcoder.com" \
ANTHROPIC_API_KEY="sk-your-api-key-here" \
claude

Troubleshooting

Claude Code won't connect

  • Verify your API key is correct
  • Check the base URL has no trailing slash
  • Ensure your key has access to Claude models
  • Try running with --debug flag: claude --debug

Authentication errors

  • Make sure you're using your 3xCoder API key, not an Anthropic key
  • Check that the key hasn't expired or been revoked in the dashboard

Model not found

  • Verify the model is available: curl https://api.3xcoder.com/v1/models -H "Authorization: Bearer $ANTHROPIC_API_KEY"

3xCoder — Unified AI API Endpoint