TokiLabsDocs
System setup

Linux setup guide

For mainstream distributions such as Ubuntu, Debian, Fedora and Arch, as well as WSL and remote servers. Instructions assume bash.

One key works with every model. Your key is stored only in your own browser and is never uploaded to any server.
No key yet? Create one in Get an API key first.

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:

Terminal · nvm (Recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.bashrc
nvm install --lts
node -v
Terminal
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
With Node installed from the system package manager, npm 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.

VariableValueUsed by
ANTHROPIC_BASE_URLhttps://api.tokilabs.xyzClaude Code, Anthropic SDK
ANTHROPIC_AUTH_TOKENsk-your-keyClaude Code
Terminal · bash
cat >> ~/.bashrc <<'EOF'

# Toki Labs · Claude
export ANTHROPIC_BASE_URL="https://api.tokilabs.xyz"
export ANTHROPIC_AUTH_TOKEN="sk-your-key"
EOF
source ~/.bashrc

Check that it worked

If you use zsh, replace ~/.bashrc with ~/.zshrc; for fish, use syntax like set -Ux ANTHROPIC_BASE_URL https://api.tokilabs.xyz.
Terminal
echo $ANTHROPIC_BASE_URL

4. Verify the connection

If you get a JSON model list containing "data", both the endpoint and the key are fine.

Terminal
curl "$ANTHROPIC_BASE_URL/v1/models" -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN"
A 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

Terminal · Official install script
curl -fsSL https://claude.ai/install.sh | bash

Or install with npm:

Terminal · npm
npm install -g @anthropic-ai/claude-code

Skip the official account sign-in on first launch:

Terminal
[ -f ~/.claude.json ] || echo '{"hasCompletedOnboarding": true}' > ~/.claude.json

Start it in your project directory:

Terminal
cd your-project
claude

After 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:

Terminal
docker run --rm \
  -e ANTHROPIC_BASE_URL=https://api.tokilabs.xyz \
  -e ANTHROPIC_AUTH_TOKEN=sk-your-key \
  your-image

Revert

When you no longer need it, delete these environment variables to restore the defaults:

Terminal
# Open ~/.bashrc in an editor, delete the 2 export lines under "# Toki Labs · Claude", then:
unset ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN