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
| Variable | Value |
|---|---|
ANTHROPIC_BASE_URL | https://api.claudexia.tech |
ANTHROPIC_API_KEY | Your 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"
claudeWindows PowerShell
powershell
$env:ANTHROPIC_BASE_URL = "https://api.claudexia.tech"
$env:ANTHROPIC_API_KEY = "YOUR-KEY"
claudePermanent setup (settings.json)
To avoid setting environment variables every time, create a settings file:
Linux / macOS
bash
mkdir -p ~/.claudeWindows PowerShell
powershell
New-Item -ItemType Directory -Force "$HOME\.claude" | Out-NullExample 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
- Install Node.js 18+ from nodejs.org.
- Open PowerShell and run: npm install -g @anthropic-ai/claude-code
- Create the settings directory: New-Item -ItemType Directory -Force "$HOME\.claude"
- Create settings.json with the configuration above.
- Run claude in PowerShell.
GUI mode
Claude Code also has a GUI interface:
- Install Claude Code as above.
- Run: claude --gui
- It opens in your browser with the same settings.
- 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.