New to AgentRouter? Start here. Join with my referral
LESS SETUP. MORE MAKING.

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.

Find your guide Pick a tool. We’ll take it from there.
FIRST THINGS FIRST

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.
Create an account
CHOOSE YOUR WORKSPACE

What are we setting up?

Same router. Your kind of workflow.

YOUR NEXT STEPS

Claude Code

A little help. A lot of possibility.

  1. 1

    Make yourself at home

    Create an account with AgentRouter, or sign in if you already have one.

  2. 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. 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.

THE RECOMMENDED ROUTE

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 guide

Where your config lives

User config

Default locations. Custom configuration directories can change these paths.

Windows
Your user profile
%USERPROFILE%\.claude\settings.json
Find this folder

Press Win + R, paste this folder path, and press Enter. %USERPROFILE% expands to your own user folder.

%USERPROFILE%\.claude

Or 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.json
Find this folder

The ~ means your home directory. In a graphical file manager, press Ctrl + H if you need to show hidden folders.

~/.claude

Or 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.

Claude CodeCC Switch setup

Off by default. Leaves your app’s existing permission settings unchanged; it does not remove permissions you already configured.

settings.json
{
  "$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.

Keys stay out of this page. Model support depends on your router.
YOUR NEXT STEPS

ChatGPT / Codex

From the first prompt to the final push.

  1. 1

    Make yourself at home

    Create an account with AgentRouter, or sign in if you already have one.

  2. 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. 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 config

Default locations. Custom configuration directories can change these paths.

Windows
Your user profile
%USERPROFILE%\.codex\config.toml
Find this folder

Press Win + R, paste this folder path, and press Enter. %USERPROFILE% expands to your own user folder.

%USERPROFILE%\.codex

Or 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.toml
Find this folder

The ~ means your home directory. In a graphical file manager, press Ctrl + H if you need to show hidden folders.

~/.codex

Or 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.

ChatGPT / CodexConfig template

Off by default. Leaves your app’s existing permission settings unchanged; it does not remove permissions you already configured.

config.toml
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.

Keys stay out of this page. Model support depends on your router.
YOUR NEXT STEPS

OpenCode

Your terminal. Your way of building.

  1. 1

    Make yourself at home

    Create an account with AgentRouter, or sign in if you already have one.

  2. 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. 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 config

Default locations. Custom configuration directories can change these paths.

Windows
Your user profile
%USERPROFILE%\.config\opencode\opencode.jsonc
Find this folder

Press Win + R, paste this folder path, and press Enter. %USERPROFILE% expands to your own user folder.

%USERPROFILE%\.config\opencode

Or 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.jsonc
Find this folder

The ~ means your home directory. In a graphical file manager, press Ctrl + H if you need to show hidden folders.

~/.config/opencode

Or 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.

OpenCodeConfig template

Off by default. Leaves your app’s existing permission settings unchanged; it does not remove permissions you already configured.

opencode.jsonc
{
  "$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.

Keys stay out of this page. Model support depends on your router.
THE SMALL PRINT, SIMPLIFIED

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.org

Codex and OpenCode use this OpenAI API base:

https://agentrouter.org/v1

They 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.

A LITTLE HELP, STEP BY STEP

Set up CC Switch.

A guided illustration of CC Switch v4.0.22. Follow along in the real app. This demo doesn’t install, connect, or change anything.

01 / GET READY

Bring three things.

Install CC Switch from its official release page. Have your router’s address, API key, and model name ready.

  • Claude Code must already be installed.
  • Back up existing settings before changing them.
  • Keep keys, CC Switch exports, and backups private.
CC Switch v4.0.22 release

Use Windows with Windows, or Linux with Linux. Windows CC Switch + WSL needs additional directory/network setup and is outside this walkthrough.

C CC Switch Illustration
YOUR CONNECTION DETAILS
Router name
AgentRouter
API Endpoint
https://agentrouter.org/v1
API Key
YOUR_API_KEY
Model
gpt-6.1-sol

Never paste your key into this illustration.

Step 1 of 6

Source-derived, simplified UI · v4.0.22 provider form · Routing documentation. Other releases may look different.