Claude Code
Claude Code can connect to bus4ai through environment variables. Once configured, your local terminal can use bus4ai balance for Claude-related model calls.
Prerequisites
Create an API Key in the bus4ai Console (opens in a new tab).
Environment Variables
PowerShell:
$env:ANTHROPIC_AUTH_TOKEN="your bus4ai API Key"
$env:ANTHROPIC_BASE_URL="https://bus4ai.com"Bash or Zsh:
export ANTHROPIC_AUTH_TOKEN="your bus4ai API Key"
export ANTHROPIC_BASE_URL="https://bus4ai.com"If your Claude Code version uses OpenAI-compatible settings, use OPENAI_API_KEY and OPENAI_BASE_URL instead. The exact variable names depend on your client version.
Start Claude Code
Run this inside your project:
claudeIf the chat opens and the model responds, your configuration is working.
Recommendations
- Create a dedicated API Key for Claude Code
- Do not commit API keys into your repository
- If a request fails, check balance, key status, and whether the Base URL contains an extra path