Claude Code Setup
Claude Code is Anthropic's official CLI programming assistant. With RouterBus, you can use Claude Code without a direct Anthropic subscription.
Prerequisites
- Claude Code installed
- RouterBus API Key created
Configuration
Option 1: Environment Variables
Add to your shell config (~/.bashrc or ~/.zshrc):
bash
export ANTHROPIC_BASE_URL=https://routerbus.com
export ANTHROPIC_AUTH_TOKEN=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThen reload:
bash
source ~/.bashrc # or source ~/.zshrcOption 2: Config File
Edit ~/.claude/settings.json:
json
{
"env": {
"ANTHROPIC_BASE_URL": "https://routerbus.com",
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}Verify
Test the connection:
bash
claude "hello"If you get a response, the setup is complete.
Common Commands
bash
# Use a specific model
claude --model claude-sonnet-4-20250514
# Interactive mode
claude
# Single question
claude "explain what this code does"
# Read a file
claude "review this file" < main.goTroubleshooting
"Unable to connect to Anthropic services"
Check the following:
- Is
ANTHROPIC_BASE_URLset tohttps://routerbus.com? - Is your API Key valid with sufficient balance?
- Can your network reach routerbus.com?
How to switch models?
Use the --model flag or the /model command in interactive mode.