Why you'd want this
Claude Code requires an Anthropic API key by default. But the key is just a credential — Claude Code itself is an open tool that talks to any Anthropic-compatible API endpoint.
This matters if:
- You want cheaper access via a reseller
- You want to avoid Anthropic's per-token billing for heavy use
- Your region has payment or access restrictions
What you need
An sk_live_ key from an Anthropic-compatible API provider like Antex, and two environment variables.
Setup in under 2 minutes
macOS / Linux:
export ANTHROPIC_BASE_URL=https://api.antex.dev
export ANTHROPIC_API_KEY=sk_live_YOUR_KEY
claudeWindows PowerShell:
$env:ANTHROPIC_BASE_URL = "https://api.antex.dev"
$env:ANTHROPIC_API_KEY = "sk_live_YOUR_KEY"
claudePermanent (recommended) — Claude Code settings file:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.antex.dev",
"ANTHROPIC_API_KEY": "sk_live_YOUR_KEY"
}
}Save this to ~/.claude/settings.json (Linux/Mac) or %USERPROFILE%\.claude\settings.json (Windows).
Verify it works
Run claude and start a session. Run /doctor inside Claude Code — it should report the base URL and confirm API connectivity.
Web search and web fetch
Claude Code's built-in web_search and web_fetch tools require upstream support. Antex supports both — they're not blocked at the proxy layer.
Model selection
You can specify any model Claude Code supports. The --model flag and in-session /model command work normally. Antex supports all current Claude 3.x and 4.x models.
Troubleshooting
401 errors — wrong or revoked key. Get a fresh one from the dashboard.
403 errors — your IP isn't bound to the key yet (first use binds it), or you're on a new IP. Check the dashboard for IP slot usage.
429 errors — usage window exhausted. Your dashboard shows exactly when it clears.