Skip to main content
RocketKey

Set up Claude Code with a RocketKey API key on Windows, macOS and Linux (ANTHROPIC_BASE_URL, settings.json, VS Code)

Configure Claude Code with a RocketKey API key: ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN for bash, PowerShell, CMD, settings.json and VS Code.

Updated 20 Oct 2026

This page is the configuration reference: environment variables, settings.json and the VS Code extension. If you don't have a key yet, read Getting started first.

Every snippet below uses the placeholder key sk-rk-YOUR_KEY_HERE: replace it with your own key.

Before you start

  • Claude Code is installed (the claude command runs in your terminal).
  • If you ever signed in to Claude Code with an Anthropic account, type /logout in Claude Code first and remove any ANTHROPIC_API_KEY variable. The commands below already clear it in the current window.
  • Claude Code's base URL has no /v1 at the end.

Option 1: environment variables (quickest)

Paste into your terminal, then run claude in the same window:

macOS/Linux
unset ANTHROPIC_API_KEY
export ANTHROPIC_BASE_URL='https://rocketkeyapi.indexes.social'
export ANTHROPIC_AUTH_TOKEN='sk-rk-YOUR_KEY_HERE'
PowerShell
Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue
$env:ANTHROPIC_BASE_URL = 'https://rocketkeyapi.indexes.social'
$env:ANTHROPIC_AUTH_TOKEN = 'sk-rk-YOUR_KEY_HERE'
CMD
set ANTHROPIC_API_KEY=
set ANTHROPIC_BASE_URL=https://rocketkeyapi.indexes.social
set ANTHROPIC_AUTH_TOKEN=sk-rk-YOUR_KEY_HERE

The variables only last for that window. To keep them, add the export lines to ~/.bashrc / ~/.zshrc, or use option 2.

Option 2: settings.json (permanent)

Add the env block to ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json). If the file already has content, merge just the env part:

json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://rocketkeyapi.indexes.social",
    "ANTHROPIC_AUTH_TOKEN": "sk-rk-YOUR_KEY_HERE"
  }
}

Claude Code extension for VS Code

Add to your VS Code settings.json (Command Palette → "Preferences: Open User Settings (JSON)"):

json
{
  "claudeCode.environmentVariables": [
    {
      "name": "ANTHROPIC_BASE_URL",
      "value": "https://rocketkeyapi.indexes.social"
    },
    {
      "name": "ANTHROPIC_AUTH_TOKEN",
      "value": "sk-rk-YOUR_KEY_HERE"
    }
  ]
}

Reload the VS Code window after saving.

Choosing a model

Claude Code picks models by its opus, sonnet and haiku slots. To pin a specific model, add ANTHROPIC_DEFAULT_SONNET_MODEL (or _OPUS_, _HAIKU_) with a model ID from the Models page. A wrong model ID causes error 404.

Check it works

In Claude Code, type /status: the base URL line must show RocketKey's address. Send a short question to make sure the key works.

Common errors

  • 401 / Invalid API key: wrong or deleted key, or an old ANTHROPIC_API_KEY is still set. See error 401.
  • 402 ExceededBudget: daily cap reached. See error 402.
  • 429 / 529 overloaded: see error 429.

Need help?

Pick a contact channel below.

Support hours: 8:00 – 22:00 (GMT+7), every day

We never ask for your password or API key.