Skip to content

Claude Code Integration

Claude Code is Anthropic’s official terminal-based AI coding assistant. It operates directly inside your CLI to inspect codebases, execute unit tests, manage git commits/PRs, and perform interactive debugging.

Through the KoboiLLM API gateway, you can route Claude Code to official Claude models as well as cross-provider models (GPT-4o, Gemini, DeepSeek) while benefiting from local payments, unified key management, and real-time usage tracking.


Step 1: Obtain API Key & Base URL

  1. API Key: Generate an API Key under Virtual Keys in your KoboiLLM dashboard (sk-xxxx). Ensure All Team Models is selected.
  2. Base URL: Point to KoboiLLM’s Anthropic-compatible endpoint:
    https://api.koboillm.com/v1

Step 2: Configure Environment Variables

Configure Anthropic’s standard environment variables in your terminal session:

Linux / macOS (Bash/Zsh):

Terminal window
# Point Claude Code to KoboiLLM's gateway
export ANTHROPIC_BASE_URL="https://api.koboillm.com/v1"
# Set your KoboiLLM API Key
export ANTHROPIC_AUTH_TOKEN="sk-xxxx"
export ANTHROPIC_API_KEY="sk-xxxx"
# Optional: Enable dynamic model discovery
export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1

Windows (PowerShell):

Terminal window
$env:ANTHROPIC_BASE_URL="https://api.koboillm.com/v1"
$env:ANTHROPIC_AUTH_TOKEN="sk-xxxx"
$env:ANTHROPIC_API_KEY="sk-xxxx"
$env:CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1

Step 3: Launching Claude Code

Once environment variables are exported, launch Claude Code with your target model:

Terminal window
# Using Claude 3.5 Sonnet
claude --model anthropic/claude-3-5-sonnet
# Using GPT-4o
claude --model openai/gpt-4o