Skip to main content

Claude Code

On 2026-09-22, Claude Code 2.1.278 completed a minimal live call with claude-haiku-4-5 and the ANTHROPIC_AUTH_TOKEN configuration on this page. Both Bearer and x-api-key work for Messages; configure your client as described in Authentication & Base URL.

Anthropic's official CLI. Connects to TokenRoute over the Anthropic-compatible protocol, giving you the Claude family and other compatible models.

No /v1 in the Base URL

Claude Code speaks the Anthropic protocol, so the Base URL is https://api.smartwan.com — do not append /v1.

Before you start

You need an API Key with available quota. Copy model names from the model list — they are case-sensitive.

Windows one-click setup

Don't want to install the CLI and edit settings.json by hand? GSS Deploy (Windows one-click setup) can do it automatically. Windows only; follow the steps below on macOS or Linux.

Installation​

OSRecommendedAlternative
Windowsirm https://claude.ai/install.ps1 | iex (PowerShell, no admin rights needed)winget install Anthropic.ClaudeCode
macOScurl -fsSL https://claude.ai/install.sh | bashbrew install --cask claude-code
Linuxcurl -fsSL https://claude.ai/install.sh | bash—

The npm install works everywhere but requires Node.js 22+: npm install -g @anthropic-ai/claude-code

System requirements: Windows 10 1809+ / Windows Server 2019+ (WSL 2 also works), Ubuntu 20.04+ / Debian 10+ / Alpine 3.19+. Alpine additionally needs bash, curl, libgcc, libstdc++ and ripgrep.

Configuration​

Pick either method.

Method 1: CC-Switch (GUI)​

Download, install and run it from sourceforge.net/projects/cc-switch.mirror.

  1. Click Claude in the top navigation bar

  2. Click + in the top-right to add a provider

  3. Fill in:

    FieldWhat to enter
    Provider nameTokenRoute (your choice)
    Websitehttps://www.tokenroute.com/
    API KeyYour API Key
    API endpointhttps://api.smartwan.com
  4. Click Save

The CLI and the desktop app share this one configuration.

Method 2: Hand-written settings.json​

mkdir -p ~/.claude
cat > ~/.claude/settings.json << 'EOF'
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.smartwan.com",
"ANTHROPIC_AUTH_TOKEN": "sk-your-token",
"ANTHROPIC_MODEL": "claude-haiku-4-5"
}
}
EOF

In Windows CMD, use mkdir %USERPROFILE%\.claude. In PowerShell, use New-Item -ItemType Directory -Force "$env:USERPROFILE\.claude". The config file still goes at .claude/settings.json.

Credentials must live inside the env object

Placed at the JSON top level they have no effect, and Claude Code will still ask you to sign in.

Also, never set both ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY — the former sends an Authorization: Bearer header, the latter sends x-api-key. TokenRoute uses the Bearer form, i.e. ANTHROPIC_AUTH_TOKEN.

Verify​

claude --version
claude doctor
claude

Once in a session, run /status and confirm two things:

  • Anthropic base URL points to https://api.smartwan.com
  • The credential source is ANTHROPIC_AUTH_TOKEN

Then send a test message.

Switching models​

Type /model in a session and press Enter, choose with the arrow keys, and confirm with Enter. It applies immediately and returns you to the conversation.

Available Claude models:

claude-opus-5
claude-sonnet-5
claude-haiku-4-5
claude-fable-5

With hand-written config, change env.ANTHROPIC_MODEL and restart. Models is authoritative for names.

Useful commands​

CommandPurpose
/clearClear context and start fresh
/modelSwitch models
/compactCompress session history to save context
/usage, /costToken spend for the current session
/helpAll command documentation
/Pop up command autocompletion

You can also just describe what you want in the conversation — Claude Code reads and edits repository files on its own.

Custom commands go in two places: .claude/commands/ per project, ~/.claude/commands/ per user. For more elaborate reusable capabilities, use Skills (.claude/skills/<name>/SKILL.md).

Full command reference in the official docs.

Desktop app​

Download from claude.com/download.

The desktop app needs CC-Switch's local routing:

  1. In CC-Switch click Claude at the top, then enable local routing to the left of the button
  2. Back in Claude, open the top-left menu → Gateway → Inference configuration
  3. Switch to the Connection tab and check the CC Switch status badge in the top-right — green is healthy, red is not
  4. Click Test Connection
  5. Scroll down and click Test model discovery
  6. Once both are green, click Save & Apply Changes

Return to the conversation home, pick a model from the dropdown below the input box, and send a message to verify.

If the connection test stays red and messages get no response: quit Claude first, then CC-Switch, and restart them in that order, then redo step 3.

Troubleshooting​

SymptomFix
No .claude directory or settings.jsonmkdir it manually, or launch the client once
Still prompted to sign inCredentials aren't inside the env object, or the JSON structure is wrong
Authentication failureCheck the key starts with sk- and hasn't expired; the URL is https://api.smartwan.com (no /v1); and you haven't set both token variables

More in the FAQ.