Integrate Truefoundry with Claude Code Max
Claude Code Max can be integrated with TrueFoundry AI Gateway using a dedicated configuration pattern.Prerequisites for Claude Code Max integration
Before integrating Claude Code Max with TrueFoundry, ensure you have:- Claude Max Subscription: An active Anthropic Claude Max subscription (required for this integration flow)
- TrueFoundry Account: Create a Truefoundry account and follow the instructions in our Gateway Quick Start Guide
When creating the Anthropic provider account in TrueFoundry for this setup, you can use a dummy API key value. The actual Anthropic
Authorization header is sent by Claude Code (from your Max account session) and forwarded by the gateway at request time. See Anthropic model integration for account setup steps.- Claude Code Installation: Install Claude Code following the official documentation
- Configure models in Truefoundry for each provider you want to use

- Global:
~/.claude/settings.json - Project-specific:
.claude/settings.jsonin your project directory
- Anthropic Max includes everything in Pro, plus significantly higher usage capacity (5x or 20x vs Pro), higher output limits, priority access during high traffic, and early access to advanced features.
- You keep using your Anthropic account/session for Claude Code, while TrueFoundry handles gateway authentication independently via
x-tfy-api-key. - You get centralized governance from TrueFoundry (usage visibility, quotas/rate limits, RBAC, logs, and guardrails) without changing your day-to-day Claude Code workflow.
- You keep one consistent gateway endpoint and model abstraction, so teams can evolve routing/fallback/cost controls centrally with minimal client-side config changes.
Authorization header for Anthropic account auth.Use
x-tfy-api-key in ANTHROPIC_CUSTOM_HEADERS so the gateway can authenticate separately.
- Set
ANTHROPIC_BASE_URLto your TrueFoundry Gateway URL. - Set
ANTHROPIC_CUSTOM_HEADERSwithx-tfy-api-key. - Start Claude Code and sign in with your Anthropic subscription account when prompted.
settings.json variant for Max subscription:
Auth behavior in this mode:
x-tfy-api-keyis used by TrueFoundry AI Gateway for gateway authentication.Authorizationfrom Claude Code (Anthropic login/session) is forwarded to Anthropic provider requests.
your-truefoundry-api-keywith your TrueFoundry API keyGATEWAY_BASE_URLwith your TrueFoundry AI Gateway Base URL (how to find it)- Update the model names to match your TrueFoundry configured models in
provider-name/model-nameformat (supports Anthropic, Bedrock and Vertex AI providers)
For Claude Code CLI and VS Code extension usage patterns, refer to the main Claude Code integration guide.