CLI Tool Setup Guides

Connect your favorite tools.Route them through ARouter.

Step-by-step setup guides for Claude Code, Codex CLI, Cursor, Continue, MITM tools, and more. All guides are written for the same ARouter endpoint so teams can copy, paste, and connect fast.

Claude Code

Install Claude Code CLI, then point ANTHROPIC_BASE_URL to ARouter and set model aliases in ~/.claude/settings.json.

Managed config
~/.claude/settings.json
npm install -g @anthropic-ai/claude-code
Setup Steps
  1. Install Claude Code and run `claude` once to verify the CLI is available.
  2. Set `ANTHROPIC_BASE_URL` to `https://arouter.alterdev.site/v1` and `ANTHROPIC_AUTH_TOKEN` to your ARouter API key.
  3. Optionally map the default opus, sonnet, and haiku model variables to your chosen ARouter model paths.

JSON

~/.claude/settings.json

{
  "hasCompletedOnboarding": true,
  "env": {
    "ANTHROPIC_BASE_URL": "https://arouter.alterdev.site/v1",
    "ANTHROPIC_AUTH_TOKEN": "<Your Key>",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "<Model-ID>",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "<Model-ID>",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "<Model-ID>"
  }
}

OpenAI Codex CLI

Codex uses a provider block in ~/.codex/config.toml plus an API key in ~/.codex/auth.json.

Managed config
~/.codex/config.toml + ~/.codex/auth.json
npm install -g @openai/codex
Setup Steps
  1. Install Codex CLI and verify with `codex`.
  2. Set `base_url` to `https://arouter.alterdev.site/v1` inside the `model_providers.KRouter` block and keep `wire_api = "responses"`.
  3. Store `OPENAI_API_KEY` in `~/.codex/auth.json`, then set your main model and optional subagent model.

TOML

~/.codex/config.toml

model = "gpt-5.5"
model_provider = "KRouter"
sandbox_mode = "danger-full-access"
model_reasoning_effort = "xhigh"

[model_providers.KRouter]
name = "KRouter"
base_url = "https://arouter.alterdev.site/v1"
wire_api = "responses"

[agents.subagent]
model = "cx/gpt-5.3-codex"

JSON

~/.codex/auth.json

{
  "auth_mode": "apikey",
  "OPENAI_API_KEY": ""
}

OpenCode

OpenCode stores provider and model configuration in ~/.config/opencode/opencode.json.

Managed config
~/.config/opencode/opencode.json
npm install -g opencode-ai
Setup Steps
  1. Install OpenCode and verify the CLI is available.
  2. Create a provider named `krouter` that uses the OpenAI-compatible SDK with `baseURL = https://arouter.alterdev.site/v1`.
  3. Attach your ARouter API key, register one or more models, and optionally set a subagent explorer model.

JSON

~/.config/opencode/opencode.json

{
  "provider": {
    "krouter": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "https://arouter.alterdev.site/v1",
        "apiKey": "YOUR_AROUTER_API_KEY"
      }
    }
  },
  "model": "krouter/provider/model-id"
}

Open Claw

Open Claw uses ~/.openclaw/openclaw.json and can map a default model plus per-agent overrides.

Managed config
~/.openclaw/openclaw.json
Setup Steps
  1. Define provider `krouter` with `baseUrl = https://arouter.alterdev.site/v1` and your ARouter API key.
  2. Set the default agent model to `krouter/provider/model-id`.
  3. If needed, override individual agent models for specific workflows.

JSON

~/.openclaw/openclaw.json

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "krouter/provider/model-id"
      }
    }
  },
  "models": {
    "providers": {
      "krouter": {
        "baseUrl": "https://arouter.alterdev.site/v1",
        "apiKey": "YOUR_AROUTER_API_KEY"
      }
    }
  }
}

Factory Droid

Factory Droid writes a custom model entry in ~/.factory/settings.json or %USERPROFILE%\\.factory\\settings.json.

Managed config
~/.factory/settings.json
Setup Steps
  1. Add a custom model entry whose `baseUrl` is `https://arouter.alterdev.site/v1`.
  2. Use your ARouter API key in the `apiKey` field.
  3. Set the model field to the routed model path you want the tool to call.

JSON

~/.factory/settings.json

{
  "customModels": [
    {
      "model": "provider/model-id",
      "id": "custom:KRouter-0",
      "baseUrl": "https://arouter.alterdev.site/v1",
      "apiKey": "YOUR_AROUTER_API_KEY",
      "provider": "openai"
    }
  ]
}

Cursor

Cursor uses the custom OpenAI API flow and expects an externally reachable endpoint.

Guide-based setup
Cursor Settings > Models
Setup Steps
  1. Open Cursor Settings and go to Models.
  2. Enable the OpenAI API key option, then set Base URL to `https://arouter.alterdev.site/v1`.
  3. Paste your ARouter API key and add a custom model path.
The current setup flow marks Cursor as requiring an external URL rather than localhost.

Cline / Kilo Code / Roo

These tools mainly need provider selection, base URL, API key, and a model path.

OpenAI-compatible guide
Tool settings panel
Setup Steps
  1. Open each tool's settings panel.
  2. Choose an OpenAI-compatible provider. Roo may follow an Ollama-style path depending on the client build.
  3. Set Base URL to `https://arouter.alterdev.site/v1` for Cline and Kilo, or `https://arouter.alterdev.site` for Roo if the client expects the raw host.
  4. Paste the API key and select your routed model path.
If Roo accepts the full OpenAI-compatible path directly, use the /v1 endpoint first. Fall back to the raw host only when the client rejects it.

Continue

Continue expects an OpenAI provider model object in its configuration file.

Config file
Continue config file
Setup Steps
  1. Open the Continue configuration file.
  2. Add an OpenAI model object whose `apiBase` points to `https://arouter.alterdev.site/v1`.
  3. Fill in the ARouter API key and the model path you want to route.

JSON

continue config

{
  "apiBase": "https://arouter.alterdev.site/v1",
  "title": "provider/model-id",
  "model": "provider/model-id",
  "provider": "openai",
  "apiKey": "YOUR_AROUTER_API_KEY"
}

Antigravity / Copilot / Kiro

These tools do not follow the normal custom-provider path. The current product routes them through the MITM-oriented setup inside the dashboard.

MITM flow
Dashboard > CLI Tools > MITM
Setup Steps
  1. Open the MITM tools section and start the MITM service with the required system permissions.
  2. Accept certificate and DNS/network changes required by the tool-specific flow.
  3. Select an ARouter API key and map each exposed alias to the upstream model route you want.
This mirrors the intent of the current CLI Tools tab, where MITM tools link to a separate flow instead of using the same generic setup card.

Hermes Agent

Hermes Agent uses a configuration block in ~/.hermes/config.yaml plus an API key in ~/.hermes/.env.

Managed config
~/.hermes/config.yaml + ~/.hermes/.env
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
Setup Steps
  1. Install Hermes Agent and ensure the CLI is available.
  2. Set `base_url` to `https://arouter.alterdev.site/v1` and `provider: "custom"` in `~/.hermes/config.yaml`.
  3. Store `OPENAI_API_KEY` in `~/.hermes/.env`.

YAML

~/.hermes/config.yaml

model:
  default: "provider/model-id"
  provider: "custom"
  base_url: "https://arouter.alterdev.site/v1"

BASH

~/.hermes/.env

OPENAI_API_KEY=YOUR_AROUTER_API_KEY