RequestBeam

Documentation

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.

text
ANTHROPIC_BASE_URL=https://api.requestbeam.com/anthropic

Prerequisites

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:

bash
curl -fsSL https://claude.ai/install.sh | bash

If 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:

bash
npm install -g @anthropic-ai/claude-code

Do not use sudo npm install -g @anthropic-ai/claude-code; it can create permission problems for later upgrades.

Verify the CLI after installation:

bash
claude --version
claude doctor

On 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:

bash
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:

bash
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 ~/.zshrc

On Linux with bash, write the same variables to ~/.bashrc and run source ~/.bashrc.

Windows PowerShell temporary settings:

powershell
$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:

powershell
[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:

json
{
  "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-5
  • claude-fable-5-1
  • claude-haiku-4-5
  • claude-opus-4-5
  • claude-opus-4-6
  • claude-opus-4-7
  • claude-opus-4-8
  • claude-opus-5
  • claude-opus-5-5
  • claude-sonnet-4-5
  • claude-sonnet-4-6
  • claude-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:

bash
claude "Reply exactly OK."

You can also start interactive mode:

bash
claude

On 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:

bash
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:

http
x-api-key: YOUR_REQUESTBEAM_API_KEY
anthropic-version: 2023-06-01
http
Authorization: Bearer YOUR_REQUESTBEAM_API_KEY
anthropic-version: 2023-06-01

Responses keep the native Anthropic Messages JSON or SSE event format. They are not converted to OpenAI format.

Troubleshooting

  • ANTHROPIC_BASE_URL must 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 ~/.zshrc on macOS, run source ~/.zshrc or open a new terminal before starting Claude Code.
  • If claude returns command not found, confirm the install location is in PATH; a common location is ~/.local/bin/claude.
  • If claude doctor reports missing environment variables, run echo $ANTHROPIC_BASE_URL and echo $ANTHROPIC_MODEL in 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.
  • POST https://api.requestbeam.com/anthropic/v1/messages: Anthropic Messages-compatible endpoint.