Use Claude Code with Tokensmind
Quickstart
This guide gets Claude Code talking to Tokensmind in a few minutes.1. Install Claude Code
Install script
npm
Requires Node.js 18+2. Point Claude Code at Tokensmind
For Anthropic-compatible access via Tokensmind, set:ANTHROPIC_BASE_URL→https://tokensmind.aiANTHROPIC_AUTH_TOKEN→ API key from TokensmindANTHROPIC_MODEL→ a model id from the model list
- macOS
- Windows
- Check your default shell:
- Append exports (replace
TOKENSMIND_API_KEY):
- Reload:
- Verify in a new terminal:
3. Run
From your project:
- Edit
~/.claude.json(macOS/Linux) orC:\Users\%USERNAME%\.claude.json(Windows). - Set
hasCompletedOnboardingtotrue:
- Save and run
claudeagain.
More ways to pick models (priority high → low)
- In session:
/model <name>for a one-off switch.
- CLI flag:
claude --model <name>for one run.
- Env defaults (global):
- OPUS — hard reasoning / architecture
- SONNET — everyday coding
- HAIKU — quick checks, search
settings.json(project or user home):
CC-Switch
- Open CC-Switch → Add provider.

- Choose Custom.

- Enter API key and endpoint.

- Add to save.

- Home → select tokensmind → Start.

VS Code extension
- Install the extension.

Ctrl + Shift + P/Cmd + Shift + P→ Settings.

- Search Claude Code →
Claude Code: Environment Variable→ Edit in settings.json.

- Fill
claudeCode.environmentVariableswith Tokensmind values.

FAQ
Q: 401 , No token provided...
In the Claude terminal run /config, enable Use custom API key, verify the token.
Q: zsh: command not found: claude on macOS
The binary exists but isn’t on PATH. Common locations:
~/.claude/bin~/.local/bin
~/.claude/bin:
~/.local/bin:
Q: Cannot reach Anthropic
Newer Claude Code builds expectANTHROPIC_AUTH_TOKEN instead of ANTHROPIC_API_KEY. Update the header name and reload env—key value stays the same. Follow the env steps above.
Q: Login API Error 403


