Prerequisites
- Claude Code installed and working
- An Infravelle API key
Clear existing Anthropic login
If you’ve previously logged in to Claude Code with an Anthropic account, cached credentials take precedence over environment variables. Clear them first:Set your API key
Add these three lines to your shell profile (~/.zshrc on macOS, ~/.bashrc on Linux):
ANTHROPIC_API_KEY="" must be an empty string. If it contains any value, Claude Code uses it directly against Anthropic, bypassing Infravelle.
The base URL must not include /v1. Claude Code appends /v1/messages itself.
Reload your shell after saving:
Use Infravelle alongside a direct Anthropic subscription
Use Infravelle alongside a direct Anthropic subscription
To keep Create the wrapper script:Add Reload your shell, then verify:Use
claude connected to your Anthropic account, create a wrapper command instead of modifying your shell profile.Add your Infravelle API key to your shell profile (~/.zshrc or ~/.bashrc):~/.local/bin to your PATH if it isn’t already:claude-infravelle for Infravelle sessions and claude for your Anthropic subscription. You don’t need to clear your Anthropic login.Verify
Use different models
Pass any Infravelle model ID with the--model flag:
400 error. Browse per-model capabilities in the directory API.
These are some of the models available through Infravelle:
To list available models:
/model picker in interactive sessions lists only Claude tier names (Opus, Sonnet, and Haiku). To switch to a non-Claude model mid-session, type the full ID: /model deepseek-v4-flash. You can also remap the tier aliases (next section) so picker entries route through Infravelle.
Override model tier aliases
Claude Code uses three model tiers (sonnet, opus, haiku). You can override which model each tier maps to:claude-infravelle wrapper, add these exports to the wrapper script instead.