Skip to main content
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:
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. Want just the binary, with no agent setup? Install with --no-configure:
These top-level commands require a CLI release that includes the flat command layout; v0.2.0 and older do not support them. After that release is published, run aireserve update, then aireserve refresh. Before stable publication, test with an explicit --version canary install. The old aireserve router configure spelling remains accepted for existing scripts and hooks.

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.
  • Your MCP servers keep working. Existing .mcp.json and ~/.claude.json files are left byte-for-byte unchanged, and stdio MCP servers keep inheriting your shell environment exactly as they do first-party. Prefer isolation? aireserve configure claude-code --isolate-mcp-env turns on Claude Code’s CLAUDE_CODE_MCP_ALLOWLIST_ENV=1 (servers then need their credentials declared in their own env); --no-isolate-mcp-env undoes it.
  • A real undo. aireserve 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

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

Credentials

The managed key the browser sign-in mints lives in ~/.config/aireserve/credentials.json (mode 0600, your user only; AIRESERVE_CONFIG_DIR or XDG_CONFIG_HOME relocate it). It is never written into ~/.codex/config.toml or ~/.claude/settings.json. Instead each harness is configured to call aireserve token <harness> — Codex through its provider’s auth.command, Claude Code through apiKeyHelper — and the CLI exchanges the key for a gateway session token that expires within the hour. Sessions authenticate with that short-lived token, so a harness debug log, HTTP trace, or crash report that captures an Authorization header holds a credential that is worthless minutes later rather than a durable key. Pausing or revoking the key in the portal still takes effect on the very next request: the gateway re-reads the parent key for every session token. Credentials are isolated by harness and config directory. Separate CLAUDE_CONFIG_DIR or CODEX_HOME profiles can use different organizations on the same gateway. Helpers and cost hooks name that profile explicitly. An explicit gateway or portal mismatch never falls back to another stored key. The helper validates its cached token at the gateway every time it runs. A live token is reused without another mint; a revoked or evicted token is replaced. Changing the parent key selects a different cache. If validation is unavailable, the helper fails rather than returning a potentially rejected credential. aireserve unconfigure removes only the selected profiles’ credentials and caches and restores their recorded settings. It revokes the parent key’s sessions only when no other stored profile or legacy entry still uses that key.

Escape hatches

The CLI never locks you in:
  • claude --setting-sources '' --settings ~/.claude/original.settings.json runs one Claude Code session with your saved pre-gateway user settings, including your original credential helper if you had one. The empty source list prevents the gateway’s global helper from being inherited, even when you launch from your home directory. This escape excludes current user, project, and local settings files; enforced managed policy still applies. Normal configured sessions are unaffected. Reconfigure or refresh updates this saved snapshot unless you have edited it.
  • codex --profile original does the same for Codex.
  • aireserve 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 (covers gateway model names and the optional stdio MCP environment-isolation setting) and/or Codex CLI ≥ 0.147 (the version with catalog support).
Prefer a guided browser flow instead? Only the Claude Code connect page still offers a one-click browser wizard; the Codex page is CLI-first, since a browser-written static key can neither refresh Codex’s model list nor issue short-lived tokens. Each agent’s docs page keeps the manual environment-variable setup for machines without the CLI.