Your favorite tools.
One good start.
A little guidance goes a long way. Connect your coding tools to AgentRouter and get back to the things you want to build.
Let’s get you a key.
New here? Create your AgentRouter account, then make an API key in your dashboard. Already have one? Head straight to your tool below.
Referral link · I may receive a benefit when you sign up.What are we setting up?
Same router. Your kind of workflow.
Claude Code
A little help. A lot of possibility.
- 1
Make yourself at home
Create an account with AgentRouter, or sign in if you already have one.
- 2
Get your API key
Create a key in your router’s dashboard. Keep it private; this guide never asks you to enter it.
- 3
Connect through CC Switch
This router uses OpenAI Responses. Claude Code speaks Anthropic Messages, so use the CC Switch walkthrough below to translate between them. Do not point Claude Code directly at a Responses-only endpoint.
Let CC Switch connect the dots.
Required for the Responses-only route in this guide. Optional for Codex and OpenCode, which already speak Responses.
Read the CC Switch routing guideWhere your config lives
User configDefault locations. Custom configuration directories can change these paths.
Windows
Your user profile%USERPROFILE%\.claude\settings.jsonFind this folder
Press Win + R, paste this folder path, and press Enter. %USERPROFILE% expands to your own user folder.
%USERPROFILE%\.claudeOr paste this into Win + R or Command Prompt (not PowerShell):
explorer.exe "%USERPROFILE%\.claude"If the folder or file is missing, create it at the shown location when adding your configuration. Back up an existing file before editing it. These commands only open folders; they do not create or modify anything.
Linux
Your home directory~/.claude/settings.jsonFind this folder
The ~ means your home directory. In a graphical file manager, press Ctrl + H if you need to show hidden folders.
~/.claudeOr paste this into a terminal in a Linux desktop session:
xdg-open "$HOME/.claude"xdg-open needs a desktop file manager; it may not work over SSH, on a headless server, or in WSL. If the tool runs inside WSL, its config is in the Linux home directory—not your Windows profile.
If the folder or file is missing, create it at the shown location when adding your configuration. Back up an existing file before editing it. These commands only open folders; they do not create or modify anything.
These are your user-level settings, not the separate .claude.json file. Official documentation
Browsers can’t reliably open local folders. Copy a path or command above; this page never reads your files.
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"respectGitignore": true,
"env": {
"ANTHROPIC_BASE_URL": "https://agentrouter.org",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "gpt-6.1-sol[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-6.1-sol[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-6.1-sol[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-6.1-sol[1m]",
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": 128000
},
"model": "opus[1m]",
"autoUpdatesChannel": "latest",
"enableWorkflows": true
}
Provider settings, not a direct Responses connection. Set up the provider in CC Switch first. Once routing is active, CC Switch manages the live local URL and auth placeholder—do not overwrite those with this upstream config.
ChatGPT / Codex
From the first prompt to the final push.
- 1
Make yourself at home
Create an account with AgentRouter, or sign in if you already have one.
- 2
Get your API key
Create a key in your router’s dashboard. Keep it private; this guide never asks you to enter it.
- 3
Save your config.toml
Copy or download the config, replace YOUR_API_KEY in your own editor, then save it at the location below. Back up and merge with an existing file rather than replacing it blindly. Restart Codex after saving.
Where your config lives
User configDefault locations. Custom configuration directories can change these paths.
Windows
Your user profile%USERPROFILE%\.codex\config.tomlFind this folder
Press Win + R, paste this folder path, and press Enter. %USERPROFILE% expands to your own user folder.
%USERPROFILE%\.codexOr paste this into Win + R or Command Prompt (not PowerShell):
explorer.exe "%USERPROFILE%\.codex"If the folder or file is missing, create it at the shown location when adding your configuration. Back up an existing file before editing it. These commands only open folders; they do not create or modify anything.
Linux
Your home directory~/.codex/config.tomlFind this folder
The ~ means your home directory. In a graphical file manager, press Ctrl + H if you need to show hidden folders.
~/.codexOr paste this into a terminal in a Linux desktop session:
xdg-open "$HOME/.codex"xdg-open needs a desktop file manager; it may not work over SSH, on a headless server, or in WSL. If the tool runs inside WSL, its config is in the Linux home directory—not your Windows profile.
If the folder or file is missing, create it at the shown location when adding your configuration. Back up an existing file before editing it. These commands only open folders; they do not create or modify anything.
This file belongs to Codex, not the ChatGPT website. If you set CODEX_HOME, look in that directory instead. Official documentation
Browsers can’t reliably open local folders. Copy a path or command above; this page never reads your files.
web_search = "live"
model = "gpt-6.1-sol"
model_reasoning_effort = "ultra"
model_provider = "agentrouter"
preferred_auth_method = "apikey"
model_context_window = 1000000
model_auto_compact_token_limit = 900000
[model_providers."agentrouter"]
name = "AgentRouter"
base_url = "https://agentrouter.org/v1"
wire_api = "responses"
experimental_bearer_token = "YOUR_API_KEY"
Replace YOUR_API_KEY in your own editor. Downloading does not install anything. Merge carefully if you already have a config; do not create duplicate TOML tables or JSON keys.
OpenCode
Your terminal. Your way of building.
- 1
Make yourself at home
Create an account with AgentRouter, or sign in if you already have one.
- 2
Get your API key
Create a key in your router’s dashboard. Keep it private; this guide never asks you to enter it.
- 3
Save your opencode.jsonc
Copy or download the config, replace YOUR_API_KEY in your own editor, then save it at the location below. Back up and merge with an existing file rather than replacing it blindly. Restart OpenCode after saving. In OpenCode, choose this provider’s model with /models.
Where your config lives
User configDefault locations. Custom configuration directories can change these paths.
Windows
Your user profile%USERPROFILE%\.config\opencode\opencode.jsoncFind this folder
Press Win + R, paste this folder path, and press Enter. %USERPROFILE% expands to your own user folder.
%USERPROFILE%\.config\opencodeOr paste this into Win + R or Command Prompt (not PowerShell):
explorer.exe "%USERPROFILE%\.config\opencode"If the folder or file is missing, create it at the shown location when adding your configuration. Back up an existing file before editing it. These commands only open folders; they do not create or modify anything.
Linux
Your home directory~/.config/opencode/opencode.jsoncFind this folder
The ~ means your home directory. In a graphical file manager, press Ctrl + H if you need to show hidden folders.
~/.config/opencodeOr paste this into a terminal in a Linux desktop session:
xdg-open "$HOME/.config/opencode"xdg-open needs a desktop file manager; it may not work over SSH, on a headless server, or in WSL. If the tool runs inside WSL, its config is in the Linux home directory—not your Windows profile.
If the folder or file is missing, create it at the shown location when adding your configuration. Back up an existing file before editing it. These commands only open folders; they do not create or modify anything.
opencode.json is also supported. Use your existing config rather than creating both. OPENCODE_CONFIG can point to a custom file. Official documentation
Browsers can’t reliably open local folders. Copy a path or command above; this page never reads your files.
{
"$schema": "https://opencode.ai/config.json",
"disabled_providers": [],
"watcher": {
"ignore": [
".git/**",
"node_modules/**",
"dist/**",
"build/**",
".next/**",
"coverage/**",
"__pycache__/**",
".venv/**",
"*.log"
]
},
"provider": {
"agentrouter": {
"name": "AgentRouter",
"npm": "@ai-sdk/openai",
"options": {
"baseURL": "https://agentrouter.org/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"gpt-6-astra": {
"name": "6 Astra",
"reasoning": true,
"tool_call": true,
"attachment": true,
"temperature": false,
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"limit": {
"context": 1000000,
"output": 128000
},
"options": {
"reasoningEffort": "max",
"reasoningSummary": "auto",
"textVerbosity": "medium",
"include": [
"reasoning.encrypted_content"
]
},
"variants": {
"none": {
"disabled": true
},
"minimal": {
"disabled": true
},
"low": {
"reasoningEffort": "low"
},
"medium": {
"reasoningEffort": "medium"
},
"high": {
"reasoningEffort": "high"
},
"xhigh": {
"reasoningEffort": "xhigh"
},
"max": {
"reasoningEffort": "max"
}
}
},
"gpt-6.1-sol": {
"name": "6.1 Sol",
"reasoning": true,
"tool_call": true,
"attachment": true,
"temperature": false,
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
},
"limit": {
"context": 1000000,
"output": 128000
},
"options": {
"reasoningEffort": "max",
"reasoningSummary": "auto",
"textVerbosity": "medium",
"include": [
"reasoning.encrypted_content"
]
},
"variants": {
"none": {
"disabled": true
},
"minimal": {
"disabled": true
},
"low": {
"reasoningEffort": "low"
},
"medium": {
"reasoningEffort": "medium"
},
"high": {
"reasoningEffort": "high"
},
"xhigh": {
"reasoningEffort": "xhigh"
},
"max": {
"reasoningEffort": "max"
}
}
}
}
}
}
}
Replace YOUR_API_KEY in your own editor. Downloading does not install anything. Merge carefully if you already have a config; do not create duplicate TOML tables or JSON keys.
A few things worth knowing.
Keep the setup simple.
Keep your credentials yours.
Which URL should I use?
This guide’s router root is:
https://agentrouter.orgCodex and OpenCode use this OpenAI API base:
https://agentrouter.org/v1They use /responses under that base. Claude Code sends Anthropic Messages to CC Switch locally, which translates them to Responses for the router. A model’s name alone does not determine its API format.
Do I need to share my API key?
No. Keep it in your own app configuration. Never send it with this guide, post it publicly, or put it into a shared HTML file. This page doesn’t collect keys or make API calls.
Is CC Switch required?
For Claude Code with this Responses-only router setup, yes: it provides the needed protocol translation. Claude Code itself does not universally require CC Switch—native Anthropic-compatible services do not need this particular bridge.
Codex and the supplied OpenCode provider already use Responses, so CC Switch is optional for them.
What does the permissions option change?
It includes the author’s high-access presets: broad tool access for OpenCode, bypass mode and warning suppression for Claude Code, or disabled approvals and full access for Codex. It is off by default and not needed for the connection itself.
Leaving it off omits those settings from the generated files. It doesn’t undo any permissions already present in an existing configuration, and omission is not a promise of sandboxing.