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
claudecommand runs in your terminal). - If you ever signed in to Claude Code with an Anthropic account, type
/logoutin Claude Code first and remove anyANTHROPIC_API_KEYvariable. The commands below already clear it in the current window. - Claude Code's base URL has no
/v1at the end.
Option 1: environment variables (quickest)
Paste into your terminal, then run claude in the same window:
unset ANTHROPIC_API_KEY
export ANTHROPIC_BASE_URL='https://rocketkeyapi.indexes.social'
export ANTHROPIC_AUTH_TOKEN='sk-rk-YOUR_KEY_HERE'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'set ANTHROPIC_API_KEY=
set ANTHROPIC_BASE_URL=https://rocketkeyapi.indexes.social
set ANTHROPIC_AUTH_TOKEN=sk-rk-YOUR_KEY_HEREThe 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:
{
"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)"):
{
"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.