Back to resourcesResources · command-line tool

Your AI subscriptions, routed with data.

ia-router sends each task to the model that performs best at that kind of work (Claude, Codex or Gemini) based on objective metrics from Arena and Artificial Analysis, not on the hunch of the day. It runs on the official CLIs and your own subscriptions.

Terminal with the ia-router header: logo, date of the Arena and Artificial Analysis metrics, the three available models and the input box
The header shows where the metrics that drive the routing come from, which models you have available and the box where you type or drag files.
The problem

You pay for three subscriptions. Which one do you send each task to?

You choose by eye

Every week a new model is “the best”. Without a common criterion, you decide out of habit.

One quota runs out and the others go unused

You always use the same model until the rate limit, while the other two are left untouched.

Rankings move, your setup does not

What was true a month ago may not be true today, and nobody tells you what changed.

How it works

One score per model and per kind of task, with published data.

  1. 01

    It classifies the task

    Code, debugging, writing, analysis, math, long context, images… by rules, spending no quota.

  2. 02

    It scores each model

    Accuracy (Arena Elo per category, with a margin of error), speed (tokens per second) and cost (price per million tokens), relative to your models.

  3. 03

    It runs in your official CLI

    If there is a rate limit or a missing login, it tries the next one. Each answer shows the exact model and the tokens it used.

Terminal with a task and the routing table: score per model, detected categories and chosen model
A real task: how it classifies it and what score each model gets.
Terminal with the /scores command: table of scores per category and model with accuracy, speed and cost
/scores: what the router picks in each category. With a category it shows the breakdown and the sources.

Everything is explainable: every number has its source in plain sight, and when you update the metrics you see what changed in the routing.

Use cases

For anyone who uses several AIs every day.

Daily development with several subscriptions

Code goes to the most accurate model according to Arena and the coding benchmarks; quick tasks go to the fastest one. You stop deciding out of habit.

Looking after your quota

For repetitive tasks you prioritize cost. The router spreads the work so the same model does not always run out while the others sit idle.

Analyzing files

You drag code, images or PDFs onto the terminal. Text is appended as context; images and PDFs go only to the models that can open them.

Long documents

For long context it looks at specific metrics (long-context reasoning and Arena long queries), not the overall average.

Connecting your apps (Gmail, Calendar…)

You register MCP servers once and any model uses them: summarize today’s emails, book a block on your calendar, query your CRM.

Scripts and pipes

cat error.log | ia-router ask "what is wrong?" --json: piped input and a JSON result with the model, tokens and estimated cost, ready for shell, cron or CI.

Comparing two models

ask --compare runs the same task on two models and shows both answers with time and cost. Always explicit, because it spends quota on each.

Watching your quota

ia-router usage shows tokens and estimated cost per model and how close you are to the limit you already hit. It invents no limits: it learns them from your own history.

Resuming conversations

ia-router --continue resumes the last conversation. They are stored only on your machine and you can turn it off or delete them.

Delegating from Claude Code

It registers as an MCP server: Claude Code can ask the router to send a subtask to the model that fits best.

Teams evaluating models

An objective, reproducible criterion with cited sources to decide which model to use, instead of opinions.

You set the criterion

For code, do you prioritize accuracy, speed or cost?

Five multiple-choice questions, one per kind of task. With your answers the routing is rebuilt instantly, with nothing to configure by hand. If you prefer not to answer, sensible defaults apply.

  • Speed and cost are offered only when there is data for all your models: scales are never mixed.
  • Differences within the margin of error reward nobody.
Terminal with the question “For code and debugging, what do you prioritize?” and four options: accuracy, balanced, speed and cost
The priorities selector: arrows and Enter.
New in 0.4 · Connectors

Let any model use your other apps.

You register MCP servers once (Gmail, Calendar, Drive, Slack, GitHub, your CRM…) and the router hands them to claude, codex and agy through a single proxy, and each task gets only the connectors it needs. One place for permissions, audit and credentials, with whichever model.

  • The router never touches OAuth tokens: each MCP server does its own login. Keys can be ${NAME} references to your environment.
  • They can read and write: hide tools with allow/deny lists or turn them off with /connectors off.
  • Every call is recorded in a local log, without arguments or results.
  1. 1 · Register a server
    ia-router connectors add files -- npx -y @modelcontextprotocol/server-filesystem ~/Documents

    Use the MCP server of the app you want; its documentation explains how to log in.

  2. 2 · Test it without spending quota
    ia-router connectors test
  3. 3 · Use it from the chat
    ia-router

    With connectors registered, every task uses them; /connectors off turns them off. For agy, once: ia-router connectors install agy.

Terminal registering two official MCP servers (filesystem and memory), testing them with connectors test and listing them
Real output: two official MCP servers are registered, tested without spending quota and listed. Any model uses them through the same proxy.
No surprises

Designed not to take control away from you.

Your official CLIs, your login

It never touches OAuth tokens: each CLI uses its own session and its own subscription.

No “allow everything”

It never turns on flags that disable the CLIs’ permissions.

Data with sources

Arena (CC BY 4.0) and Artificial Analysis, with attribution and date on every screen.

No dependencies

Only the Python standard library (3.9 or higher). A lightweight install.

Works offline

It ships with the latest Arena snapshot; updating is optional and visible.

Open source

Public code on GitHub under Apache-2.0: use it and modify it, keeping the attribution to the author.

Install

Mac, Linux and Windows. Pick your system.

Available for macOS, Linux and Windows (with WSL 2). It requires Python 3.9 or higher and has no other dependencies. You also need at least one of the official CLIs installed and logged in (claude, codex or agy): the router does not install them for you.

  • macOS: Homebrew or pipx.
  • Linux: pipx, with your distribution's package manager.
  • Windows: install WSL 2 once and follow the Linux steps inside Ubuntu.
  1. 1 · Install

    macOS

    Homebrewbrew install Mgobeaalcoba/tap/ia-router

    Or with pipx: brew install pipx && pipx ensurepath and then pipx install ia-router.

    Linux

    Debian / Ubuntusudo apt update && sudo apt install -y pipx curl && pipx ensurepath
    Fedorasudo dnf install -y pipx curl && pipx ensurepath
    pipxpipx install ia-router

    On another distribution: python3 -m pip install --user pipx && python3 -m pipx ensurepath. Open a new terminal after ensurepath.

    Windows (WSL 2)

    PowerShell (admin)wsl --install -d Ubuntu

    Restart, open Ubuntu from the Start menu, create your user and follow the Linux steps above inside that window. Install and log in to claude, codex or agy inside WSL as well. For the web interface use ia-router ui --no-open and open the address it prints in your Windows browser.

  2. 2 · Verify
    ia-router --version
    ia-router doctor

    doctor shows which CLIs you have installed and which model each one uses, spending no quota. If it says command not found, run pipx ensurepath and open a new terminal.

  3. 3 · Open it
    ia-router

    The first time it checks which CLIs you have installed and gives you the exact step for any that are missing; then, before spending anything, it detects which model each one uses and, if the metrics are old, offers to update them.

  4. 4 · (Optional) Add speed and cost

    Create a free key at artificialanalysis.ai and save it in a .env file:

    mkdir -p ~/.ia-router && echo 'ARTIFICIAL_ANALYSIS_API_KEY=your_key' > ~/.ia-router/.env
    ia-router metrics refresh
  5. Update and uninstall

    Homebrew: brew upgrade ia-router · brew uninstall ia-router
    pipx: pipx upgrade ia-router · pipx uninstall ia-router
    pip: python3 -m pip install -U ia-router · python3 -m pip uninstall ia-router

    Uninstalling does not delete your data (~/.ia-router).

Terminal showing the first open on a machine that only has claude: the table of CLIs and the exact step to install codex and antigravity
Real output of the first open with only claude installed: it tells you what is missing and how to fix it, without installing anything for you. Repeat it with /setup.
New in 0.6

For scripts, for comparing and for watching your quota.

Terminal with ask --compare: the same task run on claude and on codex, each answer with its model, tokens, time and estimated cost
ask --compare: one task, two models, with time and cost. Always explicit: it spends quota on each.
Terminal with ia-router usage: tokens over the last 5 hours, 24 hours and 7 days per model, and the estimated cost
ia-router usage: tokens and estimated cost per model. The limit is learned from your history; without a recorded rate limit there is no reference.
Terminal with a piped input and the JSON output of ask --json filtered with jq
Script mode: piped input and --json output (model, tokens, estimated cost, routing), ready for shell, cron or CI.
New · in the browser

The same tool, without the terminal too.

ia-router ui opens a local tab with the same identity as the CLI. One rule: whatever you can do in one you can do in the other. It listens on 127.0.0.1 only and every request needs a random token.

ia-router web interface with a real answer from antigravity: model, tokens, time, estimated cost and why that model was picked
A real answer in the browser, with the model, tokens, estimated cost and "Why this model".
Web interface with Compare: the same question answered by antigravity and codex, side by side
Compare: one task, two models, side by side. It spends quota on each.
Web interface with the routing preview: the ranking of models for the task you wrote, spending no quota
Preview routing: which model the router would pick and why, before spending anything.
Connector manager: the real memory server added from a template and tested, with its nine tools
Connectors from the page: a template, a free command or a URL; test without spending quota.
Connector manager asking you to confirm the exact command before saving it
A free command is shown and confirmed before it is saved. It never goes through a shell and secrets never come back to the page.
Settings: the state of the CLIs, token usage and history per model
Settings: the state of the CLIs, login check, usage and history per model.
Settings with the score per model for the coding category and where each number comes from
Scores per category, with the source of every number (Arena, and speed and cost if you have the key).
In all honesty

What is worth knowing.

Questions

What people usually ask.

Does it cost anything?

No. ia-router is free, open-source software (Apache-2.0). You use your own Claude, Codex and Antigravity subscriptions; the router adds no cost.

Do my prompts go through any of your servers?

No. Each task runs in the official CLI you are already logged into. The router only reads public Arena pages and, if you turn on the free key, queries the Artificial Analysis API. The usage log does not store your prompts; the saved conversations you can resume do, but only on your machine, readable just by you, and you can turn them off or delete them.

Which operating systems does it run on?

On macOS and Linux, and on Windows through WSL 2 (the Linux that ships with Windows). On Windows you install WSL once with wsl --install -d Ubuntu and, inside Ubuntu, follow the Linux steps; the official CLIs (claude, codex, agy) are installed inside WSL as well. The steps for each system are below.

Should I install it with Homebrew or pip?

If you use macOS with Homebrew, brew install Mgobeaalcoba/tap/ia-router is the simplest. On Linux and on Windows (WSL), pipx install ia-router. Both install the same program and are updated and uninstalled independently.

Which models does it support?

The three official CLIs: claude (Claude Code), codex (OpenAI Codex) and agy (Antigravity, from Google). One installed is enough, although it splits work better with several. Others can be added by editing a configuration file.

How reliable are the metrics?

Accuracy comes from Arena (human preference in blind comparisons, with style control and a margin of error) and, with a key, from correct-answer benchmarks by Artificial Analysis. Differences that fall within the margin of error reward nobody, and every score shows its sources.

How are they kept up to date?

The software ships with the latest Arena snapshot, so it works offline. On startup, if the metrics are more than 7 days old, it offers to update them and shows you every step and what changed in the routing. Nothing is queried unless you ask.

What if I do not have all three CLIs installed?

It works with just one, although everything will go to that model. The first time you open the chat, if a CLI is missing or you are not logged in, it shows a table and the exact step for each one (install and log in). You can repeat it any time with /setup or ia-router setup, and optionally check the logins (one minimal query per CLI, always asking first). The router installs nothing and never logs in for you.

Is there a graphical interface, or only the terminal?

Both. ia-router ui opens a browser tab with the same identity as the terminal: chat with live answers, attachments, compare models, a routing preview, scores, priorities, metrics, usage and a connector manager. Everything the CLI does can be done there and the other way round. It runs only on your machine (127.0.0.1) and every request needs a random token; there is nothing to install and no new dependencies.

What are connectors, and is it safe to give it access to my email?

Connectors are MCP servers (Gmail, Calendar, Slack, GitHub…) that the router hands to any model. Each server does its own login: the router never touches your tokens. By default they can read and write, so a model could send an email if you ask it to; you can hide tools with allow/deny lists or turn them off with /connectors off. Every call is recorded in a local log without arguments or results.

Is it in English or Spanish?

The interface and the documentation of the program are in English. The task classifier understands tasks written in English and in Spanish.

Try it

Stop choosing by eye.

Install it, open it and see what it picks for each kind of task and why. If you want this criterion for your team, let’s talk.