top of page
Search

How to Set Up Claude Code with a Custom API Endpoint

Claude Code ships with Anthropic's API as the default endpoint. But it supports a custom base_url — pointing it at any OpenAI-compatible API including multi-model routers, local inference servers, or enterprise gateways. This guide shows you how in under 2 minutes.

How requests flow when you set ANTHROPIC_BASE_URL — Claude Code routes through Adorbis to 41 AI models automatically

Why change the base_url?

  • Access multiple AI models (GPT, Gemini, DeepSeek, local Ollama) without switching tools

  • Route simple tasks to cheaper or free local models automatically

  • Get full visibility into what model ran, why it was selected, and what each request cost

Step 1 — Get your API key

Sign up at ai.adorbistech.com — 1,000 free credits, no card required. The key works with any OpenAI-compatible tool.

Step 2 — Set the environment variables

Claude Code reads ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY:

# macOS / Linux
export ANTHROPIC_BASE_URL=https://api.adorbistech.com/v1
export ANTHROPIC_API_KEY=your_api_key_here
claude

On Windows PowerShell:

$env:ANTHROPIC_BASE_URL = "https://api.adorbistech.com/v1"
$env:ANTHROPIC_API_KEY = "your_api_key_here"
claude

Step 3 — Verify the connection

claude -p "say hello and tell me which model you are"

The response comes back from the custom endpoint. A multi-model router will indicate which model was automatically selected.

Step 4 — Use routing-aware model strings

  • adorbis/auto — fully automatic, routes based on request complexity

  • adorbis/code — optimized for coding and debugging tasks

  • adorbis/quick — fastest response for simple tasks

  • adorbis/reasoning — high-reasoning models for complex analysis

Common issues

  • 401 Unauthorized — Check ANTHROPIC_API_KEY value

  • Connection refused — Check base_url includes /v1 with no trailing slash

  • Model not found — Check endpoint documentation for supported model strings

That is the entire setup. For 41 AI models with automatic routing and a full decision record for every request, Adorbis is free to start — no card required.

 
 
 

Comments


bottom of page