> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aireserve.com/llms.txt
> Use this file to discover all available pages before exploring further.

# aireserve CLI

> One command installs the AI Reserve CLI and connects Claude Code and Codex to the gateway — full model catalog in each agent's native picker, fully reversible.

The `aireserve` CLI is the fastest way to route your coding agents through
AI Reserve. One command installs it and configures every supported agent it
finds on your machine:

```bash theme={"dark"}
curl -fsSL https://get.aireserve.com/install.sh | sh -s -- --router
```

Your browser opens once to approve the connection — a managed API key is
minted for your account and handed to the CLI over a loopback callback. No
key to copy, nothing pasted into config files by hand.

## What you get

* **Native model pickers.** Every gateway model appears in Claude Code's
  `/model` picker and Codex's model picker with real display names, context
  windows, and reasoning-effort options you can toggle with the arrow keys.
  Models outside the Claude family appear in Claude Code under self-naming
  ids like `claude-air-gpt-5.6-sol[1m]` — the id always names the model that
  serves the request, and the gateway records both.
* **Session cost in your status line.** Claude Code's status line shows the
  session's actual server-computed spend and your remaining credits.
* **Freshness for free.** A session-start hook refreshes the model catalog at
  most every 12 hours, in the background, without delaying your session.
* **A real undo.** `aireserve router unconfigure` restores your previous
  settings exactly — every value the CLI touched is recorded before it is
  changed, and anything you edited yourself afterwards is left alone.

## Commands

```bash theme={"dark"}
aireserve router configure              # connect all installed agents (browser sign-in)
aireserve router configure claude-code  # connect one agent
aireserve router configure --api-key …  # non-interactive (CI, scripts)
aireserve router unconfigure            # restore previous settings
aireserve router refresh                # re-sync models/config now
aireserve router subagents --haiku …    # point Claude Code sub-agent tiers at any model
aireserve update                        # self-update
```

Pass `AIRESERVE_API_KEY` in the environment instead of `--api-key` to keep
the key out of shell history. Non-production gateways: add
`--base-url https://<your-uat-gateway>` (keys are environment-specific).

## Escape hatches

The CLI never locks you in:

* `claude --settings ~/.claude/original.settings.json` runs one Claude Code
  session on the setup that existed before the CLI configured anything.
* `codex --profile original` does the same for Codex.
* `aireserve router unconfigure` removes everything permanently and restores
  the recorded values.

## Requirements

* macOS or Linux (x64/arm64). Windows: install via WSL for now.
* Claude Code ≥ 2.1.118 (the version that shows gateway models by their real
  names) and/or Codex CLI ≥ 0.147 (the version with catalog support).

Prefer a guided browser flow instead? The
[Claude Code](https://portal.aireserve.com/connect/claude-code) and
[Codex](https://portal.aireserve.com/connect/codex) connect pages still offer
the one-click wizard, and each agent's docs page keeps the manual
environment-variable setup.
