Skip to main content

Claude Code

Claude Code connects to PopGo API through three Anthropic environment variables.

Before configuring​

  • This page uses placeholders only. Copy the real Key from PopGo API keys and the model from models and pricing.
  • One-click setup is for software that is already installed and has registered its protocol handler. Allow the browser to open the external app when prompted.
  • For manual setup, save one minimal Provider first. Enable streaming, tools, or multi-model routing only after the first request succeeds.

Official source and verification​

This page was verified on 2026-07-13 against the official source for Claude Code 2.1.207. Official source. Verification covers the environment variable setup documented by the official source.

One-click setup​

Sign in to the PopGo API keys page and open the action menu on the target Key row. Public documentation never creates or displays a link containing a Key. Choose CC Switch, then Claude. After importing the Claude setup, confirm the variables are loaded in your local terminal before starting a new session.

Manual setup​

Set these variables in the same terminal that will launch Claude Code.

export ANTHROPIC_BASE_URL="https://api.popgo.site"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
export ANTHROPIC_MODEL="YOUR_MODEL"
$env:ANTHROPIC_BASE_URL = "https://api.popgo.site"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_API_KEY"
$env:ANTHROPIC_MODEL = "YOUR_MODEL"
  • The PowerShell example affects only the current window. If you write user environment variables, reopen the terminal afterward too.
  • Do not add a variable that disables TLS verification. For certificate errors, check the local proxy, system time, and network interception first.

Cross-platform installation and setup​

  1. Check node --version and npm --version in the terminal that will start Claude Code.
  2. Install Claude Code using its official installation method and verify the command with claude --version.
  3. For a temporary test, set these variables in the current terminal. Reopen the terminal after saving user environment variables for long-term use:
$env:ANTHROPIC_BASE_URL = "https://api.popgo.site"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_API_KEY"
$env:ANTHROPIC_MODEL = "YOUR_MODEL"

On macOS/Linux, export the same variables in the active shell. Confirm the current session sees them, then run claude doctor. Do not disable TLS verification.

Success check​

Close any old session, restart Claude Code from the same terminal, and send a short request.

Common errors and recovery​

  • An existing terminal does not receive newly set variables automatically. Restart from the terminal where they were defined.
  • For a 401, paste YOUR_API_KEY again and remove surrounding whitespace.
  • For a 404, verify the Base URL level and make sure the client is not appending /v1 twice.