Skip to main content
Claude Code reads two environment variables to determine where to send requests. By overriding ANTHROPIC_BASE_URL to point at Tokios and setting your Tokios API key, Claude Code routes every request down your private tunnel to the model running on your hardware.

Prerequisites

Set up the environment

claude-code-windows.cmd
set ANTHROPIC_BASE_URL=https://api.tokios.com
set ANTHROPIC_API_KEY=sk-tokios-YOUR_KEY_HERE
claude --model gemma-tunnel
Replace gemma-tunnel with the exact model name you registered in the Tokios dashboard.

Persist the configuration

To avoid exporting the variables in every new terminal session, add them to your shell profile or a .env file. ~/.bashrc or ~/.zshrc Open your shell profile and append:
export ANTHROPIC_BASE_URL=https://api.tokios.com
export ANTHROPIC_API_KEY=sk-tokios-YOUR_KEY_HERE
Then reload it:
source ~/.bashrc   # or source ~/.zshrc
.env file If your workflow supports .env files (for example, via direnv or a shell plugin), create a .env in your project root:
.env
ANTHROPIC_BASE_URL=https://api.tokios.com
ANTHROPIC_API_KEY=sk-tokios-YOUR_KEY_HERE
Load it before starting Claude Code:
export $(cat .env | xargs) && claude --model gemma-tunnel

Verify the connection

Run a quick one-shot prompt to confirm that Claude Code is reaching your local model through Tokios:
claude --model gemma-tunnel -p "Say hello"
Expected output:
Hello! How can I help you today?
If you see a response, your requests are flowing through the Tokios gateway to your local model successfully.
Claude Code sends the request in Anthropic messages format. Tokios translates it to whatever your local backend expects and streams the response back.