Flatrouter
Claude Code

Configure a model provider

Connect Flatrouter to Claude Code with CC Switch — no hand-edited JSON or environment variables.

The easiest route is CC Switch, an open-source provider manager with a visual UI. No hand-edited JSON, no environment variables.

1. Install CC Switch

macOS

brew install --cask cc-switch

Or download the .dmg from Releases and install it manually.

Windows

Download the .msi installer from Releases.

Linux

# Debian / Ubuntu
sudo dpkg -i CC-Switch-*.deb

# Fedora / RHEL
sudo rpm -i CC-Switch-*.rpm

# AppImage
chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage

Requires macOS 12+, Windows 10+, or Ubuntu 22.04+ / Debian 11+ / Fedora 34+.

2. Add the provider

Step 1: create a provider

Open CC Switch, go to the provider list and click the + button in the top right.

Step 2: fill in the details

Fill in the fields below, then click + Add.

FieldValueNotes
❶ Provider nameflatrouter-claudeAnything you like — it is just a label
❷ Websitehttps://flatrouter.comThe provider's site
❸ API keyYour Flatrouter API keyFrom Console → API Keys
❹ Base URLhttps://api.flatrouter.com/anthropicNo trailing slash
❺ API format / auth fieldAnthropic Messages (native) / ANTHROPIC_AUTH_TOKEN (default)Leave as-is
❻ Model configEmptyEmpty means the default Claude models
❼ OptionsTick "Hide AI signature" and "Teammates mode"Optional
❽ Write to global config✅ TickedApplies the config to every project

CC Switch writes ~/.claude/settings.json for you — no file editing required.

Step 3: activate the provider

Back in the list, select flatrouter-claude and click Use. A "switched successfully" toast means you are done.

3. Verify

Open a project directory and start Claude Code. On the first run, press Esc to skip the login. Check the header bar for the Claude icon, then send a quick hi — a reply means requests are going through and billing is working.

Troubleshooting

Run /status inside Claude Code and check these two fields:

  • Anthropic base URL is https://api.flatrouter.com/anthropic
  • Model shows the model currently in use

Q: "Authentication error"

Check that the Anthropic base URL is correct and that the API key is still valid.

Q: Connection timeouts

Make sure the base URL is exactly https://api.flatrouter.com/anthropic, with no trailing slash.

Q: Streaming responses stall

Flatrouter already routes over global edge nodes, so this is almost always a local network issue. Check your connection and retry.

On this page