TokiLabsDocs
Tools

Claude Code

Claude Code is Anthropic's official command-line coding assistant. Point the endpoint and key at Toki Labs and it works right away, no official account needed.

One key works with every model. Your key is stored only in your own browser and is never uploaded to any server.
For installation, see the guide for your system first: Windows · macOS · Linux.

Option 1: settings.json (recommended)

Put the configuration in Claude Code's own settings file. It keeps system environment variables clean, and both the CLI and the VS Code / JetBrains extensions read it.

SystemFile location
Windows%USERPROFILE%\.claude\settings.json
macOS / Linux~/.claude/settings.json
settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.tokilabs.xyz",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-key",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

If the file already has other settings, just merge the lines under env. You can also create it with a command:

PowerShell
New-Item -ItemType Directory -Force "$HOME\.claude" | Out-Null
[IO.File]::WriteAllText("$HOME\.claude\settings.json", @'
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.tokilabs.xyz",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-key",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}
'@)
The command above overwrites any existing settings.json. If you already have settings, merge them manually.

Option 2: environment variables

Set the two environment variables ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. See Windows, macOS and Linux for each system. If both options are present, the values in settings.json take precedence.

Try it temporarily in the current terminal:

PowerShell
$env:ANTHROPIC_BASE_URL = "https://api.tokilabs.xyz"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-key"
claude

Skip the sign-in prompt

On first run, Claude Code may still ask you to sign in with an official account. Add the following entry to ~/.claude.json (on Windows %USERPROFILE%\.claude.json) to skip it:

.claude.json
{
  "hasCompletedOnboarding": true
}

Choose a model

Type /model in Claude Code to switch models. You can also pin a default model under env in settings.json:

settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.tokilabs.xyz",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-key",
    "ANTHROPIC_MODEL": "claude-opus-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
  }
}

See the model list for available model names.

Use in an IDE

The Claude Code extensions for VS Code, Cursor and JetBrains share ~/.claude/settings.json with the CLI. Configure it as in Option 1, then restart the IDE.

Confirm it works

Start claude and type /status; the Base URL field should show https://api.tokilabs.xyz.

Do not add /v1 to the end of ANTHROPIC_BASE_URL; Claude Code appends /v1/messages automatically.