Short answer: Pick a SwitchRouter Connect plan, copy your API key, and run npx switchrouter connect. The installer detects Claude Code, OpenCode, and Codex CLI on your machine, saves backups of your existing settings, and gets everything working in under 30 seconds.
Step 1: Run One Command
npx switchrouter connect
Here is what happens automatically:
- Checks your key safely: Verifies your Connect key and stores it privately on your machine (locked so only your user account can read it).
- Catches wrong keys early: If you accidentally paste a pay-as-you-go API key instead of a Connect key, the installer tells you immediately and lets you swap it on the spot.
- Simple checkbox picker: Select OpenCode, Claude Code, Codex CLI, or your Shell environment with the arrow keys and
Space. Tools you already wired up are clearly marked. - Safe, non-destructive edits: Your existing settings, comments, and other AI providers stay untouched, and a
.bakbackup file is created before anything changes.
Step 2: Check Your Balance & Health Anytime
Install globally with npm install -g switchrouter so you can use the short sr command anywhere:
# See your Naira balance, rollover bank, and usage gauges
sr status# Test your connection and check live response speed sr doctor
# Open your dashboard or add top-up credits in the browser sr dashboard sr topup ```
Step 3: Keep It Scoped to One Project (Optional)
Want to wire up a single repo without changing your global laptop settings? Pass --project — SwitchRouter creates local project files and adds them to .gitignore automatically so secrets never get pushed:
npx switchrouter connect --project
Or launch any tool for a single session without editing any config files at all:
sr run claude
sr run opencode
sr run codex
Building a web or Python app instead? Run sr init in your project folder to generate .env.local and a ready-to-use SwitchRouter client in seconds.