RequestBeam Docs
Claude Code Integration
Use RequestBeam's Claude Messages-compatible endpoint in Claude Code.
Claude Code calls models through the Anthropic Messages protocol. Set ANTHROPIC_BASE_URL to the Anthropic-compatible Base URL shown on this page.
ANTHROPIC_BASE_URL=https://api.requestbeam.com/anthropicPrerequisites
Prepare a valid RequestBeam API Key first. The key will be written to your local shell environment. Do not commit it to repositories, logs, or screenshots.
Install Claude Code
On macOS / Linux, use the native Claude Code installer:
curl -fsSL https://claude.ai/install.sh | bashIf the installer reports ~/.local/bin/claude but claude is not found, open a new terminal or add ~/.local/bin to PATH.
For older workflows, the npm package is still available:
npm install -g @anthropic-ai/claude-codeDo not use sudo npm install -g @anthropic-ai/claude-code; it can create permission problems for later upgrades.
Verify the CLI after installation:
claude --version
claude doctorOn Windows, Git Bash or WSL is recommended for Claude Code. PowerShell can also set environment variables, but persistence differs by terminal.
Configure Environment Variables
Temporary settings only affect the current terminal session:
export ANTHROPIC_AUTH_TOKEN="YOUR_REQUESTBEAM_API_KEY"
export ANTHROPIC_BASE_URL="https://api.requestbeam.com/anthropic"
export ANTHROPIC_MODEL="claude-sonnet-4-6"macOS uses zsh by default. For persistent configuration, write the variables to ~/.zshrc, then run source ~/.zshrc so the current terminal reads them immediately:
printf '%s\n' \
'export ANTHROPIC_AUTH_TOKEN="YOUR_REQUESTBEAM_API_KEY"' \
'export ANTHROPIC_BASE_URL="https://api.requestbeam.com/anthropic"' \
'export ANTHROPIC_MODEL="claude-sonnet-4-6"' \
>> ~/.zshrc
source ~/.zshrcOn Linux with bash, write the same variables to ~/.bashrc and run source ~/.bashrc.
Windows PowerShell temporary settings:
$env:ANTHROPIC_AUTH_TOKEN="YOUR_REQUESTBEAM_API_KEY"
$env:ANTHROPIC_BASE_URL="https://api.requestbeam.com/anthropic"
$env:ANTHROPIC_MODEL="claude-sonnet-4-6"PowerShell user-level persistence:
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "YOUR_REQUESTBEAM_API_KEY", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.requestbeam.com/anthropic", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "claude-sonnet-4-6", "User")Open a new PowerShell session before running claude.
Settings File
As an alternative to shell configuration, create or edit ~/.claude/settings.json. If the file already exists, merge env and model into the existing JSON instead of replacing other settings:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "YOUR_REQUESTBEAM_API_KEY",
"ANTHROPIC_BASE_URL": "https://api.requestbeam.com/anthropic",
"ANTHROPIC_MODEL": "claude-sonnet-4-6"
},
"model": "claude-sonnet-4-6"
}Available models:
claude-fable-5claude-fable-5-1claude-haiku-4-5claude-opus-4-5claude-opus-4-6claude-opus-4-7claude-opus-4-8claude-opus-5claude-opus-5-5claude-sonnet-4-5claude-sonnet-4-6claude-sonnet-5
Use GET https://api.requestbeam.com/v1/models for the models currently available to your API Key.
Start and Test
Restart Claude Code after setting the environment variables, then send a normal prompt:
claude "Reply exactly OK."You can also start interactive mode:
claudeOn first launch, Claude Code may ask for a theme, safety confirmation, terminal setup, or whether to trust the current directory. Follow the terminal prompts.
Select a Model
Set a default model with the environment variable, or choose one for a single command with --model:
claude --model claude-sonnet-4-6 "Review this PR"Endpoint Behavior
Claude Code authenticates with the configured RequestBeam API Key. The service accepts either authentication form:
x-api-key: YOUR_REQUESTBEAM_API_KEY
anthropic-version: 2023-06-01Authorization: Bearer YOUR_REQUESTBEAM_API_KEY
anthropic-version: 2023-06-01Responses keep the native Anthropic Messages JSON or SSE event format. They are not converted to OpenAI format.
Troubleshooting
ANTHROPIC_BASE_URLmust be the public API Base URL shown on this page plus/anthropic.- Do not include endpoint paths in
ANTHROPIC_BASE_URL; only the Anthropic-compatible base URL is needed. - After editing
~/.zshrcon macOS, runsource ~/.zshrcor open a new terminal before starting Claude Code. - If
claudereturns command not found, confirm the install location is inPATH; a common location is~/.local/bin/claude. - If
claude doctorreports missing environment variables, runecho $ANTHROPIC_BASE_URLandecho $ANTHROPIC_MODELin the same terminal to confirm they loaded. - If you get
401, confirm that the API Key is valid. - If the model is unavailable, confirm that the model name is from the available model list above.
- Restart the Claude Code process after changing environment variables.
Related Endpoint
POST https://api.requestbeam.com/anthropic/v1/messages: Anthropic Messages-compatible endpoint.