VS Code
Call TokenRoute from VS Code through the Cline, Codex or Claude Code extensions.
Download: code.visualstudio.com
You need an API Key with available quota. Copy model names from the model list — they are case-sensitive.
Which extension
Press Ctrl+Shift+X (Cmd+Shift+X on macOS) to open the Extensions panel:
| Extension | Best for |
|---|---|
| Cline | Entering Base URL and model name by hand — most flexible, consistent across platforms |
| Codex | Use the shared Codex configuration, then verify a call in the extension |
| Claude Code | Using Claude models inside the IDE |
All three share one API Key — no need to request separate ones.
Configuring Cline
Once installed, open the extension panel and click settings in the top-right:
| Field | What to enter |
|---|---|
| API Provider | OpenAI Compatible |
| Base URL | https://api.smartwan.com/v1 |
| OpenAI Compatible API Key | Your API Key |
| Model ID | Type the model name |
Commonly used models:
deepseek-v4-pro
claude-sonnet-5
gpt-5.5
kimi-k2.6
grok-4.6
Click Done to save.
Configuring the Codex extension
Codex CLI and the IDE extension share configuration layers. Follow Codex CLI to configure model_provider, model and model_providers.tokenroute in user-level ~/.codex/config.toml, then set the TOKENROUTE_API_KEY variable referenced by env_key.
Open the extension's gear menu and select Codex Settings → Open config.toml. Do not replace the complete provider configuration with unrelated OPENAI_* variables. After setting environment variables, fully exit VS Code and launch it from that terminal so the new process inherits them.
Shared configuration is documented in the official configuration guide. TokenRoute's minimal live test was performed in the CLI; still send a test message in the IDE as described below.
Configuring the Claude Code extension
Start from Claude Code. These are Bash environment variables; confirm the IDE has loaded them with an actual call:
export ANTHROPIC_AUTH_TOKEN="sk-your-token"
export ANTHROPIC_BASE_URL=https://api.smartwan.com
Cline speaks the OpenAI-compatible protocol — Base URL includes /v1.
Claude Code speaks the Anthropic protocol — Base URL excludes /v1.
Swapping them yields a 404.
Setting environment variables
| OS | Current terminal | Persistent |
|---|---|---|
| Windows | PowerShell: $env:NAME="value" | System environment variables, or just use the extension's settings |
| macOS | export NAME="value" | Add to ~/.zshrc |
| Linux | export NAME="value" | Add to ~/.bashrc or ~/.zshrc |
Restart VS Code after changing environment variables so it picks them up.
Verify
Send a message in the extension's chat box. A normal response means you're connected.
Troubleshooting
| Symptom | What to do |
|---|---|
| Cline returns 404 | Base URL needs /v1; the Claude Code extension does not |
| Auth failure | Check the key is complete and starts with sk-; restart VS Code after changing env vars |
| Model not found | Model ID must match the model list exactly — case-sensitive |
| Extension can't see env vars | Launch with code . from a terminal so VS Code inherits the shell environment |
For more, see the FAQ.