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
- API Key: Generate an API Key under Virtual Keys in your KoboiLLM dashboard (
sk-xxxx). Ensure All Team Models is selected. - 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):
# Point Claude Code to KoboiLLM's gatewayexport ANTHROPIC_BASE_URL="https://api.koboillm.com/v1"
# Set your KoboiLLM API Keyexport ANTHROPIC_AUTH_TOKEN="sk-xxxx"export ANTHROPIC_API_KEY="sk-xxxx"
# Optional: Enable dynamic model discoveryexport CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1Windows (PowerShell):
$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=1Step 3: Launching Claude Code
Once environment variables are exported, launch Claude Code with your target model:
# Using Claude 3.5 Sonnetclaude --model anthropic/claude-3-5-sonnet
# Using GPT-4oclaude --model openai/gpt-4o