Messages API
Using Claude Code with Truefoundry
Claude Code is Anthropic’s agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster through natural language commands.Benefits of Using Truefoundry with Claude Code.
With Portkey integration, you can enhance Claude Code with enterprise features:
- Unified AI Gateway - Route Claude Code through multiple providers (Anthropic, Bedrock, Vertex AI)
- Centralized Logs - Track all Claude Code interactions
Prerequisites
- Configure provider accounts for one or more of:
- Anthropic
- AWS Bedrock
- Google Vertex AI
- Configure models in Truefoundry for each provider you want to use
Integrate Truefoundry with Claude Code
Claude Code uses a settings.json file for configuration. You’ll need to modify the environment variables to route requests through Truefoundry.
Claude Code can be configured either globally or per project by editing the settings file:
- Global:
~/.claude/settings.json
- Project-specific:
.claude/settings.json
in your project directory
Replace:
your-truefoundry-api-key
with your TrueFoundry API keytfy-provider-name
with the TrueFoundry Provider namecontrolPlaneUrl
with your Control Plane URLprojectId
with your Google Project Idregion
with Region of the Model- Update the model name if using a different Claude model
Using Claude Code
After configuring the settings file, you can use Claude Code as normal. The Truefoundry AI Gateway will handle routing your requests to the appropriate provider based on your configuration.