Coding Tools Setup

Choose the setup path that matches how your team actually codes.

TheRouter activation is not β€œread every doc.” It is β€œget one key, point your coding tool at the right base URL, send the first successful request, then iterate.” Use this page as the hub for common coding clients and switchers.

Recommended setup paths

Open the dedicated guide when your tool needs more than a simple base URL + key swap.

OpenAI-compatible coding tools

Windsurf, Cline, Continue, and OpenCode all fit the same activation pattern: keep the OpenAI-compatible surface, set the TheRouter base URL, paste your routing key, and use exact model aliases from /v1/models.

Windsurf
Open Windsurf Settings β†’ AI β†’ Custom API
Base URL: https://api.therouter.ai/v1
API Key: <THEROUTER_API_KEY>
Model: anthropic/claude-sonnet-4.6

When to use cc-switch

Use cc-switch when your team switches between Claude Code, Codex, Gemini CLI, OpenCode, and OpenClaw and you want one desktop control plane for provider presets. TheRouter presets let cc-switch point those clients at the live routing path without editing each config by hand.

text
1. Create a TheRouter tenant API key in the dashboard.
2. Open cc-switch and choose the target app (Claude Code, Gemini CLI, OpenCode, OpenClaw, etc.).
3. Add Provider β†’ choose the TheRouter preset.
4. Paste your key, enable the preset, then restart the target CLI if required.
Why this matters
cc-switch is best when TheRouter is the routing layer for multiple local coding clients, not when your team only uses a single tool with one static configuration.

Validate before you debug

Before blaming the client, verify that the key can list models and that you are using the exact alias your tool will request.

bash
curl https://api.therouter.ai/v1/models \
  -H "Authorization: Bearer $THEROUTER_API_KEY" | head -c 400
Do not mix base URL styles
OpenAI-compatible tools should usually use https://api.therouter.ai/v1. Anthropic-native clients such as Claude Code should use the root domain https://api.therouter.ai. Gemini-native clients follow the Gemini base URL rules documented in the dedicated guide.
Help & contact