Interactive coding agents with single-provider auth
Route Codex or Claude Code between models from one provider using your saved CLI login. Every target, including the classifier, must use that provider.
These composite routing recipes use a
classifier to choose the starting tier for each user turn. Stage adjusts routing
during tool calls. forward_auth
passes your login through to the models.
Choose one recipe. Each uses local port 4123.
Codex with OpenAI
Sign in with codex login. Terra classifies, and Stage routes between Sol and Luna.
This recipe needs Codex classifier support added after v0.3.0. Install from a
checkout of current main:
Save as codex-routing.toml:
Start the server:
Create ~/.codex/switchyard.config.toml (or place it beside your config.toml if
you use a custom Codex config directory):
In another terminal, launch Codex:
Claude Code with Anthropic
Sign in to Claude Code with your Claude account. Haiku classifies, and Stage routes between Opus and Sonnet.
Install the latest release:
Save as claude-routing.toml:
Start the server:
In another terminal, launch Claude Code:
Use your saved Claude login, without an apiKeyHelper or gateway token.
Check the routing
Send a prompt, then check which models handled the answer and classification: