Skip to main content

Claude Code

Claude Code is Anthropic’s powerful AI coding assistant that works directly in your terminal and IDE.

With the OneRoute integration, you can:

  • Code with 300+ models, giving you the flexibility to pick the best model for each task
  • Track and manage your spend in one place
  • Keep a history of your conversations

Configuration

1. Quick setup with environment variables

The easiest way to integrate OneRoute with Claude Code is via environment variables:

Get your API key

Create an API key on the API Keys page.

Set environment variables

export ANTHROPIC_BASE_URL="https://gw.1route.ai"
export ANTHROPIC_AUTH_TOKEN="your_oneroute_api_key"
export ANTHROPIC_MODEL="anthropic/claude-sonnet-4-5"

Run Claude

Run claude in your terminal.

You can also configure Claude Code with a settings file, which you only need to edit once.

Create or edit your settings file: ~/.claude/settings.json

Then set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN under the env block:

{
"env": {
"ANTHROPIC_BASE_URL": "https://gw.1route.ai",
"ANTHROPIC_AUTH_TOKEN": "your_oneroute_api_key",
"ANTHROPIC_MODEL": "anthropic/claude-sonnet-4-5"
}
}