Integrations
Claude Code
Claude Code is Anthropic's command-line coding agent: it understands your whole codebase, edits files and runs commands. To use it through FlyRouter, point its API address and key at FlyRouter; every feature keeps working.
Install Claude Code
curl -fsSL https://claude.ai/install.sh | bashRun claude --version to confirm the install, and claude doctor if something looks wrong.
Set up FlyRouter
Create an API key
Create a dedicated key for Claude Code on the console's API keys page.
Add it to the settings file
Edit the user settings file ~/.claude/settings.json (on Windows, %USERPROFILE%\.claude\settings.json), creating it if needed:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.flyrouter.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-...",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
}
}Don't add /v1 to ANTHROPIC_BASE_URL.
Start and confirm
Run claude in your project and type /status. If the Anthropic base URL row shows https://api.flyrouter.ai, you're set.
Why settings.json
Settings in settings.json apply no matter which terminal or IDE launches Claude Code, and it works from the very first launch without stopping at the login screen. If a variable is set both in your shell and in settings.json, settings.json wins. Don't put a config containing your key in a project's .claude/settings.json that gets committed to Git.
You can also use environment variables (current terminal only):
export ANTHROPIC_BASE_URL="https://api.flyrouter.ai"
export ANTHROPIC_AUTH_TOKEN="sk-..."
claudeChoose a model
Claude Code's opus, sonnet and haiku aliases map to the three models configured above; haiku is also used for lightweight background tasks. Type /model in a session to switch:
- Sonnet (
claude-sonnet-5-5): the everyday workhorse, balancing speed and quality. - Opus (
claude-opus-5-5): hard problems such as large refactors and architecture. - Fable (
claude-fable-5-1): the strongest reasoning and the highest price. Type its model ID in/modelto use it.
To pin a default model, add "ANTHROPIC_MODEL": "claude-sonnet-5-5" to env. Model IDs must match the model pricing page exactly.
Troubleshooting
It still asks me to log in
Make sure ANTHROPIC_AUTH_TOKEN is in the env block of ~/.claude/settings.json, not just exported in one terminal. If you previously logged in with a Claude account, run /logout in a session to clear the old login.
"There's an issue with the selected model"
The model ID is wrong, or the key is limited to other models. Check the ID on the model pricing page and the key's model limits.
400 "Extra inputs are not permitted"
Newer Claude Code versions sometimes send experimental fields that aren't widely available yet. Add "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1" to env.
Requests time out
The first token can be slow on complex tasks. Set "API_TIMEOUT_MS": "1200000" (20 minutes) in env to allow more time.
Some features aren't available
With a third-party API address, features that depend on an Anthropic account, such as Remote Control, voice input and /fast, aren't available. Coding features are unaffected.