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.
Claude Code speaks the Anthropic protocol, so the Base URL is https://api.smartwan.com — do not append /v1.
You need an API Key with available quota. Copy model names from the model list — they are case-sensitive.
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
| OS | Recommended | Alternative |
|---|---|---|
| Windows | irm https://claude.ai/install.ps1 | iex (PowerShell, no admin rights needed) | winget install Anthropic.ClaudeCode |
| macOS | curl -fsSL https://claude.ai/install.sh | bash | brew install --cask claude-code |
| Linux | curl -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.
-
Click Claude in the top navigation bar
-
Click + in the top-right to add a provider
-
Fill in:
Field What to enter Provider name TokenRoute(your choice)Website https://www.tokenroute.com/API Key Your API Key API endpoint https://api.smartwan.com -
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.
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 URLpoints tohttps://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
| Command | Purpose |
|---|---|
/clear | Clear context and start fresh |
/model | Switch models |
/compact | Compress session history to save context |
/usage, /cost | Token spend for the current session |
/help | All 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:
- In CC-Switch click Claude at the top, then enable local routing to the left of the button
- Back in Claude, open the top-left menu → Gateway → Inference configuration
- Switch to the Connection tab and check the CC Switch status badge in the top-right — green is healthy, red is not
- Click Test Connection
- Scroll down and click Test model discovery
- 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
| Symptom | Fix |
|---|---|
No .claude directory or settings.json | mkdir it manually, or launch the client once |
| Still prompted to sign in | Credentials aren't inside the env object, or the JSON structure is wrong |
| Authentication failure | Check 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.