Table of Contents [expand]
Last updated February 25, 2026
Claude Code can use Heroku Managed Inference and Agents as a backend to power model inference.
Claude Code support with Heroku AI is dependent on the Messages API Preview and is therefore in preview.
Prerequisites
Before configuring Claude Code, you need:
A Heroku app with the Managed Inference addon provisioned using the
standardplan:heroku addons:create heroku-inference:standard -a $APP_NAMEClaude Code uses multiple models to operate, therefore model-specific addon plans (like
heroku-inference:claude-3-7-sonnet) are not supported.A Heroku Managed Inference and Agents API token:
heroku config:get INFERENCE_KEYClaude Code installed and initialized (see Claude Code Quickstart)
Configuration
Now, set the required configuration for Claude Code using environment variables or Claude Code’s configuration files.
To do this with environment variables, use the following:
export ANTHROPIC_AUTH_TOKEN="$YOUR_API_TOKEN"
export ANTHROPIC_BASE_URL="https://us.inference.heroku.com"
Alternatively, edit your Claude Code configuration (typically at ~/.claude/settings.json) with the following:
"env": {
"ANTHROPIC_AUTH_TOKEN"="your-api-token",
"ANTHROPIC_BASE_URL"="https://us.inference.heroku.com"
}
Verification
Test your configuration by running a Claude Code command:
claude-code --model claude-opus-4-6 "What is 1 + 2?"
If successful, Claude Code returns a response from your configured model.
Available Models
We suggest the latest Anthropic models for use with Claude Code. Please see Supported Models for up-to-date information on which Anthropic models are supported on Heroku Managed Inference.