Route Claude Code Through a Team Proxy with ANTHROPIC_BASE_URL
Teams often need to route AI traffic through a central gateway for cost tracking, usage limits, or compliance. Set ANTHROPIC_BASE_URL to point Claude Code at any Anthropic-compatible proxy — no code changes required.
export ANTHROPIC_BASE_URL=https://ai-gateway.yourcompany.com/anthropic
export ANTHROPIC_API_KEY=your-team-issued-key
Add these to your shell profile or a .env sourced by your team's setup script, and every developer's Claude Code session will route through the gateway automatically. This works with popular gateways including LiteLLM, Portkey, and AWS Bedrock proxies.
It's also useful locally when you want to inspect exactly what Claude Code sends and receives:
# Run a local proxy to inspect traffic
litellm --model anthropic/claude-sonnet-4-5 --port 8080
export ANTHROPIC_BASE_URL=http://localhost:8080
claude # All requests now flow through LiteLLM
Pair this with per-user API keys issued by the gateway to get per-developer cost breakdowns without sharing the master key. The gateway can also enforce rate limits or add request logging your security team requires.
One environment variable, and your whole team's usage flows through the gateway you control.
Log in to leave a comment.
When Claude writes error messages, button labels, validation text, or onboarding flows, it defaults to generic developer-speak. Add a "Users" section to your CLAUDE.md describing who your actual users are — their technical level, industry jargon, and what they care about — so Claude writes copy that makes sense to THEM, not to developers.
Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.
Every project has traps — the billing module that silently fails if you forget to queue the job, the legacy table with column names that don't match the model, the config value that must be set before tests run. Document these gotchas in your CLAUDE.md so Claude avoids the same mistakes your team spent days debugging.