Linux setup guide
For mainstream distributions such as Ubuntu, Debian, Fedora and Arch, as well as WSL and remote servers. Instructions assume bash.
1. Open a terminal
On a desktop, press Ctrl + Alt + T to open a terminal; on a server, just log in via SSH. Run the commands below as a regular user; sudo is not needed (except to install Node.js).
2. Install Node.js
Node.js 18 or later is required. Distribution packages are often too old; we recommend installing with nvm, which needs no root access:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.bashrc
nvm install --lts
node -vcurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejssudo dnf install -y nodejssudo pacman -S nodejs npmnpm install -g may require sudo. nvm avoids this problem.3. Set environment variables
Set the two variables below. The endpoint is https://api.tokilabs.xyz.
| Variable | Value | Used by |
|---|---|---|
ANTHROPIC_BASE_URL | https://api.tokilabs.xyz | Claude Code, Anthropic SDK |
ANTHROPIC_AUTH_TOKEN | sk-your-key | Claude Code |
cat >> ~/.bashrc <<'EOF'
# Toki Labs · Claude
export ANTHROPIC_BASE_URL="https://api.tokilabs.xyz"
export ANTHROPIC_AUTH_TOKEN="sk-your-key"
EOF
source ~/.bashrcCheck that it worked
~/.bashrc with ~/.zshrc; for fish, use syntax like set -Ux ANTHROPIC_BASE_URL https://api.tokilabs.xyz.echo $ANTHROPIC_BASE_URL4. Verify the connection
If you get a JSON model list containing "data", both the endpoint and the key are fine.
curl "$ANTHROPIC_BASE_URL/v1/models" -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN"401 means the key is wrong or no longer valid; for connection timeouts, check your local proxy settings. See the FAQ.5. Install Claude Code
curl -fsSL https://claude.ai/install.sh | bashOr install with npm:
npm install -g @anthropic-ai/claude-codeSkip the official account sign-in on first launch:
[ -f ~/.claude.json ] || echo '{"hasCompletedOnboarding": true}' > ~/.claude.jsonStart it in your project directory:
cd your-project
claudeAfter launch, type /status. If Base URL shows https://api.tokilabs.xyz, requests go through Toki Labs. Type /model to switch models, for example claude-opus-5-5. More settings in Claude Code configuration.
Servers and Docker
Cron jobs and systemd services do not load ~/.bashrc. Use Environment= in the unit file, or pass variables with -e in Docker:
docker run --rm \
-e ANTHROPIC_BASE_URL=https://api.tokilabs.xyz \
-e ANTHROPIC_AUTH_TOKEN=sk-your-key \
your-imageRevert
When you no longer need it, delete these environment variables to restore the defaults:
# Open ~/.bashrc in an editor, delete the 2 export lines under "# Toki Labs · Claude", then:
unset ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN