Claude Code

Route Claude Code's API calls through VibeCC for centralized billing, routing, and observability.

Setup

Set environment variables before launching Claude Code:

export ANTHROPIC_BASE_URL=https://gateway.vibecc.dev
export ANTHROPIC_API_KEY=vcc_your_key_here

Or add to your shell profile (~/.zshrc / ~/.bashrc):

echo 'export ANTHROPIC_BASE_URL=https://gateway.vibecc.dev' >> ~/.zshrc
echo 'export ANTHROPIC_API_KEY=vcc_your_key_here' >> ~/.zshrc
source ~/.zshrc

Smoke Test

curl "$ANTHROPIC_BASE_URL/v1/messages" \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","max_tokens":64,"messages":[{"role":"user","content":"ping"}]}'

Expected: HTTP 200 with "type":"message".

Verification

After running Claude Code, check the Console — usage appears in the billing dashboard within seconds.

Troubleshooting

| Issue | Fix | |-------|-----| | authentication_error | Verify ANTHROPIC_API_KEY starts with vcc_ | | model not found | Check ANTHROPIC_BASE_URL is set correctly | | Requests going to Anthropic directly | Restart your terminal after setting env vars |