Skip to content

Claude Code Setup

Claude Code is Anthropic's terminal-based AI coding assistant. This guide shows how to point it at the Claudexia API.

Required values

VariableValue
ANTHROPIC_BASE_URLhttps://api.claudexia.tech
ANTHROPIC_API_KEYYour key from Dashboard > API Keys

Important: For Claude Code the base URL is without /v1.

Quick start

Linux / macOS

bash
export ANTHROPIC_BASE_URL="https://api.claudexia.tech"
export ANTHROPIC_API_KEY="YOUR-KEY"
claude

Windows PowerShell

powershell
$env:ANTHROPIC_BASE_URL = "https://api.claudexia.tech"
$env:ANTHROPIC_API_KEY = "YOUR-KEY"
claude

Permanent setup (settings.json)

To avoid setting environment variables every time, create a settings file:

Linux / macOS

bash
mkdir -p ~/.claude

Windows PowerShell

powershell
New-Item -ItemType Directory -Force "$HOME\.claude" | Out-Null

Example settings.json

json (~/.claude/settings.json)
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.claudexia.tech",
    "ANTHROPIC_API_KEY": "YOUR-KEY",
    "ANTHROPIC_MODEL": "claude-opus-4.7",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-opus-4.7",
    "DISABLE_TELEMETRY": "1",
    "DISABLE_ERROR_REPORTING": "1",
    "DISABLE_AUTOUPDATER": "1",
    "DISABLE_COST_WARNINGS": "1"
  },
  "permissions": {
    "allow": [
      "Read", "Write", "MultiEdit",
      "WebFetch(domain:*)", "Bash", "WebSearch"
    ],
    "deny": [],
    "defaultMode": "bypassPermissions"
  },
  "model": "claude-opus-4.7",
  "skipDangerousModePermissionPrompt": true
}

Windows installation

  1. Install Node.js 18+ from nodejs.org.
  2. Open PowerShell and run: npm install -g @anthropic-ai/claude-code
  3. Create the settings directory: New-Item -ItemType Directory -Force "$HOME\.claude"
  4. Create settings.json with the configuration above.
  5. Run claude in PowerShell.

GUI mode

Claude Code also has a GUI interface:

  1. Install Claude Code as above.
  2. Run: claude --gui
  3. It opens in your browser with the same settings.
  4. Set the ANTHROPIC_BASE_URL environment variable before launching.

Troubleshooting

"This account requires login"

Make sure ANTHROPIC_BASE_URL is set correctly (without /v1). Claude Code checks this URL for authentication. If the variable is not set, it tries to authenticate with Anthropic directly.

Wrong model being used

Set ANTHROPIC_MODEL in your environment or settings.json to override the default model.