Skip to main content
plugin CX Codex

codex-multi-auth — Claude Code plugin: features and setup

codex-multi-auth is a Claude Code and Codex plugin for managing ChatGPT accounts used by the official Codex CLI. It switches accounts and checks their health.

MIT ★ 1,596 updated 2026-10-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add hashgraph-online/awesome-codex-plugins
/plugin install codex-multi-auth@awesome-codex-plugins
Open on GitHub

What codex-multi-auth does

codex-multi-auth keeps a local pool of ChatGPT OAuth accounts and helps choose which one handles the next request. Use status to inspect the pool, check to probe account health, and forecast to preview the next selection. Requests rotate only when Codex runs through codex-multi-auth-codex or mcodex.

The package includes commands for diagnosing and repairing local state, JSON reports, and quota controls. Account data lives in ~/.codex/multi-auth, with separate pools available for projects. It requires Node.js 22.19 or newer and the official Codex CLI on PATH.

What it helps with

  • switch the active Codex account
  • check the health of ChatGPT accounts
  • preview which account will handle the next request
  • repair damaged local authentication state

Example prompts for the agent

  • Add ChatGPT accounts to the pool and show their status.
  • Check account health and preview the next selection.
  • Run Codex through codex-multi-auth-codex to rotate requests across accounts.

How to install codex-multi-auth

Plugin marketplace

/plugin marketplace add hashgraph-online/awesome-codex-plugins
/plugin install codex-multi-auth@awesome-codex-plugins

Step by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own

Questions about codex-multi-auth

How do I install codex-multi-auth in Claude Code?

Run /plugin marketplace add hashgraph-online/awesome-codex-plugins, then /plugin install codex-multi-auth@awesome-codex-plugins.

What does codex-multi-auth do?

It manages a local pool of ChatGPT OAuth accounts for the official Codex CLI. It can switch accounts, check their health, and rotate requests when Codex runs through its wrapper.

What does codex-multi-auth need to run?

It requires Node.js 22.19 or newer and the official Codex CLI available on PATH.

Source text

codex-multi-auth · MIT
# codex-multi-auth

[![npm version](https://img.shields.io/npm/v/codex-multi-auth.svg)](https://www.npmjs.com/package/codex-multi-auth)
[![npm downloads](https://img.shields.io/npm/dw/codex-multi-auth.svg)](https://www.npmjs.com/package/codex-multi-auth)
[![CI](https://github.com/ndycode/codex-multi-auth/actions/workflows/ci.yml/badge.svg)](https://github.com/ndycode/codex-multi-auth/actions/workflows/ci.yml)
[![MIT license](https://img.shields.io/npm/l/codex-multi-auth.svg)](LICENSE)

<img width="1270" height="729" alt="codex-multi-auth terminal dashboard for Codex CLI multi-account OAuth account status" src="https://github.com/user-attachments/assets/0cecb77e-a6d3-432a-ba48-3577db0c7093" />

`codex-multi-auth` is a multi-account OAuth manager for the official `@openai/codex` CLI. It keeps a named pool of ChatGPT sign-ins on your machine, lets you switch the active account, and — when you run Codex through its optional wrapper — rotates accounts across live requests through a loopback-only proxy. It never installs or shadows a `codex` binary; the official OpenAI install keeps owning that command.

Use it when one Codex account is not enough: you hit rate limits or quota windows, you split work across organizations and workspaces, you want per-project account pools, or you run unattended agents that need JSON diagnostics and safe repair commands instead of one opaque auth file.

Using OpenCode rather than the Codex CLI? The sibling project [`oc-codex-multi-auth`](https://github.com/ndycode/oc-codex-multi-auth) is the plugin that manages the same kind of account pool there.

## What it does

- **Account pool** — OAuth login for multiple ChatGPT accounts, stored locally under `~/.codex/multi-auth` (files `0600`, directories `0700`), with per-project pools under `projects/<project-key>/`.
- **Switching and selection** — pin an account, pick the forecast-best one, follow saved account order within customized priority tiers with sequential scheduling, or let health- and quota-aware hybrid selection rotate for you.
- **Runtime rotation** — a default-on, loopback-only proxy that forwards Responses API, model-discovery, image, thread-goal, and Codex dictation/transcription traffic through managed accounts during wrapper-launched Codex sessions.
- **API capability evidence** — opted-in API/ZDR routes receive daily billable checks while the router runs; status distinguishes configured access programs from verified responses. See [check behavior and controls](docs/reference/commands.md#codex-multi-auth-check).
- **Diagnostics and repair** — status, live health checks, quota forecasts, JSON reports, and `fix`/`doctor`/`verify` commands that recover stale or damaged local state.
- **Luna Reserve fallback** — treats `gpt-reserve` as a separately metered Luna allowance, automatically falls back after a genuine Luna quota 429, and exposes the Reserve percentage through `limits --json --refresh`.
- **Local governance** — file-backed usage ledger, budget guards, account tags/weights/pause/drain policies, routing profiles, and an optional loopback bridge with bearer tokens for local OpenAI-compatible clients.
- **Desktop routing (optional)** — a reversible bind of the packaged Codex app plus user-level launcher helpers; official app binaries are never patched.

## The four binaries

| Binary | Role |
| --- | --- |
| `codex-multi-auth` | The account manager. Runs all management subcommands locally (`login`, `status`, `web`, `switch`, `forecast`, `rotation`, `fix`, ...). The `auth` prefix is optional: `codex-multi-auth login` ≡ `codex-multi-auth auth login`. |
| `codex-ma` | Short alias for `codex-multi-auth`, including the local real-time web dashboard. |
| `codex-multi-auth-codex` | Opt-in wrapper. Handles `auth ...` locally and forwards every other command to the official Codex CLI, enabling the rotation proxy for request-bearing commands. |
| `mcodex` | Convenience launcher over the wrapper, with optional `--monitor` and `--tmux` modes. No account logic of its own. |
| `codex-multi-auth-app-launcher` | User-level OS launcher routing helper (Windows shortcut, macOS wrapper app, Linux `.desktop`). |

## Install

Requirements: Node.js >= 22.19, and the official Codex CLI on `PATH` (`npm i -g @openai/codex`, Homebrew, or a release binary).

```bash
npm i -g codex-multi-auth
```

> [!NOTE]
> The legacy scoped prerelease `@ndycode/codex-multi-auth` is migration-only. Install `codex-multi-auth` for all new setups; see [docs/upgrade.md](docs/upgrade.md) to migrate.

## Quick start (5 minutes)

```bash
# 1. Sign in a ChatGPT account (browser OAuth, loopback callback on localhost:1455)
codex-multi-auth login

# 2. Repeat login to add more accounts, then inspect the pool
codex-multi-auth status
codex-ma web --no-open

# 3. Probe account health and preview which account would serve next
codex-multi-auth check
codex-multi-auth forecast --live
```

Headless or remote shell? Use `codex-multi-auth login --device-auth` — no callback port needed. Blocked browser? See [alternate login paths](docs/getting-started.md#log-in).

Run Codex through the wrapper so requests rotate across the pool:

```bash
codex-multi-auth-codex          # interactive TUI, rotation on by default
codex-multi-auth-codex exec "summarize this repo"
mcodex                          # same wrapper, shorter name
```

## Command map

`codex-multi-auth` ships 31 subcommands. The full surface — every flag, hotkey, and JSON mode — is in [docs/reference/commands.md](docs/reference/commands.md).

| Group | Commands | Purpose |
| --- | --- | --- |
| Accounts | `login`, `list`, `status`, `switch <i>`, `unpin`, `workspace` | sign in, inspect the pool, pin or switch the active account, select or enable/disable workspaces |
| Selection | `forecast`, `best`, `why-selected`, `check`, `limits`, `models` | preview, explain, and probe which account serves the next request |
| Runtime | `rotation status` `enable` `disable` `bind-app` `unbind-app` `reset-runtime` `reset-rate-limits` | inspect and control live rotation and the app bind |
| Repair | `fix`, `doctor`, `report`, `verify`, `verify-flagged`, `uninstall` | diagnose and repair storage, flagged accounts, and install residue; machine-readable health report |
| Governance | `usage`, `budget`, `account`, `monitor`, `history`, `resets` | usage ledger, budget limits, tags/weights/pause/drain, snapshots |
| Local clients | `bridge`, `integrations` | bearer tokens and client snippets for the loopback bridge |
| Config | `config explain` `template`, `init-config`, `debug bundle`, `features` | effective-config report, config templates, sanitized debug bundle |

Everyday examples:

```bash
codex-multi-auth switch 2                     # pin account #2
codex-multi-auth report --live --json         # full machine-readable health report
codex-multi-auth fix --live --model gpt-6.1-sol   # live repair probes with a chosen model
codex-multi-auth doctor --fix                 # diagnose and apply the safest fixes
codex-multi-auth usage --since 24h --by model # local usage ledger summary
codex-multi-auth rotation status              # is live rotation enabled?
```

## Runtime rotation, in one paragraph

With rotation on (the default), request-bearing wrapper commands — `exec`, `review`, `resume`, `fork`, `app`, and the bare TUI — route through a local proxy that picks the healthiest account per request, refreshes tokens as needed, and fails over across the pool on rate limits within a bounded retry budget. The proxy listens on loopback only, authenticates its own clients with a per-process token, forwards only Responses API, model-discovery, image, thread-goal, and `POST /transcribe` calls, and never writes account emails or tokens to client headers or logs. Transcription preserves the incoming multipart audio body and boundary, uses managed ChatGPT OAuth, and does not replay ambiguous audio uploads across accounts. Plain `codex` is never touched: rotation exists only inside `codex-multi-auth-codex`/`mcodex` sessions, or inside the packaged desktop app after an opt-in, reversible bind. Turn it off with `codex-multi-auth rotation disable` or `CODEX_MULTI_AUTH_RUNTIME_ROTATION_PROXY=0`.

### Quota cache revalidation

Local rate-limit blocks are valid for at most one hour. The next request then
rechecks upstream, including for a hard-pinned account, so an out-of-band quota
reset does not require a manual switch. A fresh upstream rejection starts a new
bounded wait; this does not reset quota or spend reset credits.

## Where state lives

| What | Path |
| --- | --- |
| Accounts, settings, quota cache, usage ledger, policies, observability | `~/.codex/multi-auth/` |
| Per-project account pools | `~/.codex/multi-auth/projects/<project-key>/` |
| Official Codex state (kept by the official install) | `~/.codex/` |
| Override the multi-auth root | `CODEX_MULTI_AUTH_DIR=<path>` |

Full path map: [docs/reference/storage-paths.md](docs/reference/storage-paths.md).

## Troubleshooting in 60 seconds

```bash
codex-multi-auth doctor --fix
codex-multi-auth check
codex-multi-auth forecast --live
```

Common symptoms — wrong active account, OAuth callback port `1455` already bound, Windows/WSL port contention, `EBUSY`/`EPERM` on Windows — are covered in [docs/troubleshooting.md](docs/troubleshooting.md).

## Documentation

| Doc | What it covers |
| --- | --- |
| [docs/index.md](docs/index.md) | Product overview — what it does at runtime and who needs it |
| [docs/README.md](docs/README.md) | Full documentation portal and sitemap |
| [docs/getting-started.md](docs/getting-started.md) | Install, first login, day-1 commands |
| [docs/features.md](docs/features.md) | Feature tour |
| [docs/architecture.md](docs/architecture.md) | Components, request flow, trust boundaries |
| [docs/configuration.md](docs/configuration.md) | Settings and environment overrides |
| [docs/reference/commands.md](docs/reference/commands.md) | Every command, flag, and hotkey |
| [docs/reference/public-api.md](docs/reference/public-api.md) | Public API stability tiers and semver contract |
| [docs/troubleshooting.md](docs/troubleshooting.md) | Recovery playbooks |
| [docs/faq.md](docs/faq.md) | Common questions |
| [docs/upgrade.md](docs/upgrade.md) | Version and legacy-package migration |
| [docs/privacy.md](docs/privacy.md) | Data handling and local storage behavior |
| [config/README.md](config/README.md) | Modern vs. legacy catalog templates |
| [CHANGELOG.md](CHANGELOG.md) | Release history (short version) |

## Release notes

- Current stable: [v2.24.0](docs/releases/v2.24.0.md) — `npm i -g codex-multi-auth`
- Earlier stable lines: [v2.6.0](docs/releases/v2.6.0.md), [v2.5.0](docs/releases/v2.5.0.md)
- Full release archive: [docs/README.md#release-history](docs/README.md#release-history)

## Terms and license

`codex-multi-auth` uses OAuth account credentials and is intended for personal development use. It is an independent open-source project, not an official OpenAI product; you are responsible for your own usage and policy compliance, and for production or commercial workloads you should use the OpenAI Platform API. "ChatGPT", "Codex", and "OpenAI" are trademarks of OpenAI.

MIT license — see [LICENSE](LICENSE).

© hashgraph-online · MIT · hashgraph-online/awesome-codex-plugins

Similar plugins

All plugins for Agent setup: memory, context, orchestration →

From the same set391

The whole set →
codex-reviewer codex-reviewer runs a secondary audit over AI-authored plans and pull requests. Catches architectural blind spots and unverified code before merge. CX Codex ★ 1,596repo stars codex-quota-title codex-quota-title shows remaining Codex quota and reset time in the Codex Desktop window title on Windows. The original title stays visible. CX Codex ★ 1,596repo stars codex-quota-optimizer codex-quota-optimizer is a Claude Code plugin that routes tasks to an adequate model and narrows repository context. It also applies layered checks. CX Codex ★ 1,596repo stars codex-process-jobs codex-process-jobs runs local builds, tests, and benchmarks as detached background processes on macOS and Linux, keeping status and logs after the agent turn ends. CX Codex ★ 1,596repo stars codex-howto codex-howto is a plugin for Claude Code and Codex with nine skills that take Codex tasks from scoping through tests and diff review to an evidence handoff. It takes work beyond code generation. CX Codex ★ 1,596repo stars codex-auto-resume codex-auto-resume monitors Codex usage limits on Windows, waits for the reset time, and automatically resumes the exact same conversation via codex queue. Built for overnight tasks. CX Codex ★ 1,596repo stars codex-agents-workflow codex-agents-workflow is a Claude Code plugin for building and running reusable agent workflows. It supports workflow setup with configurable roles and providers, plus recoverable runs. CX Codex ★ 1,596repo stars ateam ateam turns Claude into a six-role team: researcher, PM, architect, dev, QA and reviewer, joined into a configurable pipeline. CX Codex ★ 1,596repo stars

Project sponsors

Companies that keep this analytics open