Claude Code CLI Setup

Learn how to configure Claude Code CLI to use Aiberm’s API. This guide covers installation and configuration for Windows, macOS, and Linux.

What is Claude Code?

Claude Code is Anthropic’s official command-line interface (CLI) that brings AI assistance directly to your terminal and code editor. By configuring it to use Aiberm, you can access multiple AI models through a single, familiar interface.

Prerequisites

Before you begin, ensure you have:

Installation

Choose your operating system below for installation instructions.

macOS & Linux

Open your terminal and run:

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

This installation script handles all dependencies automatically—no need to pre-install Node.js or npm.

Verify installation:

claude --version

Windows

  1. Open PowerShell as Administrator (Right-click PowerShell → “Run as administrator”)

  2. Run the installation command:

irm https://claude.ai/install.ps1 | iex
  1. After installation, add Claude Code to your PATH:

    • Press Win + X and select “System”
    • Click “Advanced system settings”
    • Click “Environment Variables”
    • Under “System variables”, select “Path” and click “Edit”
    • Click “New” and add: C:\Users\YourUsername\.claude\bin
    • Click “OK” to save
  2. Restart your terminal and verify installation:

claude --version

Configuration

To use Aiberm with Claude Code, you need to set two environment variables:

  • ANTHROPIC_AUTH_TOKEN — Your Aiberm API key
  • ANTHROPIC_BASE_URL — Aiberm’s API endpoint (https://aiberm.com)

Choose one of the following configuration methods:

This method saves your API key securely and persists across sessions.

macOS & Linux

Add these lines to your shell configuration file:

For Bash (~/.bashrc or ~/.bash_profile):

export ANTHROPIC_AUTH_TOKEN="sk-your-aiberm-api-key"
export ANTHROPIC_BASE_URL="https://aiberm.com"

For Zsh (~/.zshrc):

export ANTHROPIC_AUTH_TOKEN="sk-your-aiberm-api-key"
export ANTHROPIC_BASE_URL="https://aiberm.com"

Apply the changes:

source ~/.zshrc  # or source ~/.bashrc

Windows

Using PowerShell (Persistent):

  1. Open PowerShell as Administrator
  2. Run these commands:
[System.Environment]::SetEnvironmentVariable('ANTHROPIC_AUTH_TOKEN', 'sk-your-aiberm-api-key', 'User')
[System.Environment]::SetEnvironmentVariable('ANTHROPIC_BASE_URL', 'https://aiberm.com', 'User')
  1. Restart your terminal to apply changes

Using Command Prompt (Persistent):

setx ANTHROPIC_AUTH_TOKEN "sk-your-aiberm-api-key"
setx ANTHROPIC_BASE_URL "https://aiberm.com"

Method 2: Temporary Configuration (Current Session Only)

macOS & Linux

export ANTHROPIC_AUTH_TOKEN="sk-your-aiberm-api-key"
export ANTHROPIC_BASE_URL="https://aiberm.com"

Windows PowerShell

$env:ANTHROPIC_AUTH_TOKEN="sk-your-aiberm-api-key"
$env:ANTHROPIC_BASE_URL="https://aiberm.com"

Windows Command Prompt

set ANTHROPIC_AUTH_TOKEN=sk-your-aiberm-api-key
set ANTHROPIC_BASE_URL=https://aiberm.com

Method 3: Using Claude Code Settings

Create or edit ~/.claude/settings.json:

{
  "api": {
    "baseUrl": "https://aiberm.com",
    "token": "sk-your-aiberm-api-key"
  }
}

Method 4: Using CC Switch (GUI)

CC Switch is a Claude Code provider switching tool with a graphical interface for managing multiple API provider configurations. See the repository for installation instructions.

Configure Aiberm Provider:

  1. Run CC Switch to open the configuration interface
  2. Turn off the Live proxy toggle at the top (this toggle routes requests through CC Switch’s own proxy, which is unnecessary)
  3. Add a new provider with the following settings:
    • Provider Name: Aiberm
    • Note: Aiberm
    • Website URL: https://aiberm.com
    • API Key: Your Aiberm API key
    • Request URL: https://aiberm.com (do not end with a slash)
    • API Format: Anthropic Messages (Native)
    • Main Model: claude-opus-4-6
    • Thinking Model: claude-opus-4-6-thinking
    • Haiku Default Model: claude-haiku-4-5-20251001
    • Sonnet Default Model: claude-sonnet-4-5-20250929
    • Opus Default Model: claude-opus-4-6
  4. Click “Save”

Verify Configuration

After launching Claude Code, type /status to check your configuration. If you see the following, your setup is successful:

Anthropic base URL: https://aiberm.com

You can also test by sending a message:

claude "Hi"

If configured correctly, Claude Code should respond using Aiberm’s API.

Check environment variables:

macOS/Linux:

echo $ANTHROPIC_BASE_URL
echo $ANTHROPIC_AUTH_TOKEN

Windows PowerShell:

echo $env:ANTHROPIC_BASE_URL
echo $env:ANTHROPIC_AUTH_TOKEN

Troubleshooting

”Invalid API key” Error

  • Verify your API key is correct: Console → API Keys
  • Ensure there are no extra spaces in the environment variable
  • Check that ANTHROPIC_BASE_URL is set to https://aiberm.com (without /v1)

“Connection refused” Error

  • Verify your internet connection
  • Check if you can access https://aiberm.com in your browser
  • Ensure your firewall allows outbound HTTPS connections

Claude Code Not Found

macOS/Linux:

# Check if Claude Code is in your PATH
which claude

# If not found, add to PATH in ~/.zshrc or ~/.bashrc:
export PATH="$HOME/.claude/bin:$PATH"

Windows:

  • Verify the PATH environment variable includes C:\Users\YourUsername\.claude\bin
  • Restart your terminal after adding to PATH