Skip to main content
Arbytra connects to Claude Code through environment variables, giving you access to multiple models through a single API key.

Prerequisites

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:
If you haven’t logged in with Anthropic directly, skip this step.

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 Arbytra. The base URL must not include /v1. Claude Code appends /v1/messages itself. Reload your shell after saving:
Or open a new terminal.
To keep claude connected to your Anthropic account, create a wrapper command instead of modifying your shell profile.Add your Arbytra API key to your shell profile (~/.zshrc or ~/.bashrc):
Create the wrapper script:
Add ~/.local/bin to your PATH if it isn’t already:
Reload your shell, then verify:
Use claude-arbytra for Arbytra sessions and claude for your Anthropic subscription. You don’t need to clear your Anthropic login.
Model defaults are shared. The /model command saves your choice to ~/.claude/settings.json, which both claude and claude-arbytra read. Setting /model deepseek-v4-pro in an Arbytra session changes the default for your Anthropic subscription too.To avoid this, set a default model in the wrapper script so Arbytra sessions start with the right model without touching settings.json:
The --model flag is session-only and does not persist. You can still switch models mid-session with /model, but be aware it saves globally.

Verify

Claude Code includes a system prompt on every request. The first request in a session costs more than follow-ups due to prompt caching. Factor this into your cost estimates.

Use different models

Pass any Arbytra model ID with the --model flag:
Model IDs must be exact. Claude Code requires reasoning support from every model. Models that don’t support reasoning return a 400 error. Browse per-model capabilities in the directory API. These are some of the models available through Arbytra: To list available models:
The /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 Arbytra.

Override model tier aliases

Claude Code uses three model tiers (sonnet, opus, haiku). You can override which model each tier maps to:
Add these to your shell profile alongside the other environment variables. If you’re using the claude-arbytra wrapper, add these exports to the wrapper script instead.

Switch back to direct Anthropic

Remove or comment out the three environment variables from your shell profile, then reload and re-authenticate:

Troubleshoot