ndycode/codex-multi-auth

Codex CLI multi-account OAuth manager with account switching, health checks, runtime rotation, diagnostics, and recovery tools for @openai/codex

What it solves

A single ChatGPT account linked to the Codex CLI can hit rate limits, quota windows, or be tied to one organization or workspace. This tool solves that by letting you keep a local pool of named ChatGPT sign-ins, switch which account is active, and automatically rotate accounts across live requests so you can keep working without manual account juggling.

How it works

It stores your OAuth accounts locally under ~/.codex/multi-auth (with per-project pools), and offers a set of commands to log in, list, switch, check health, and repair state. The key runtime piece is an opt-in wrapper (codex-multi-auth-codex or mcodex) that runs a loopback-only proxy. When you start Codex through that wrapper, the proxy picks the healthiest account for each request, refreshes tokens as needed, and fails over to another account on rate limits within a bounded retry budget. It only forwards a specific set of API calls (Responses, model discovery, etc.) and never writes account credentials to client headers or logs. The official codex binary is never replaced or shadowed; the wrapper simply forwards non-auth commands to it.

Who it’s for

Developers who use the official Codex CLI and need more than one ChatGPT account — for example, to work around rate limits, split work across organizations or workspaces, manage per-project account pools, or run unattended agents that need JSON diagnostics and safe repair commands instead of a single opaque auth file. It requires Node.js >= 22.19 and the official Codex CLI installed on your PATH.

Highlights

  • Local account pool with OAuth login for multiple ChatGPT accounts, stored securely (0600/0700 permissions)
  • Live rotation proxy that selects the healthiest account per request and fails over on rate limits
  • Per-project account pools and a file-backed usage ledger with budget guards
  • Diagnostics and repair commands (fix, doctor, verify) for stale or damaged local state
  • Optional loopback bridge with bearer tokens for local OpenAI-compatible clients
  • Reversible bind for the packaged desktop app (never patches official binaries)
  • Opt-in API region selection (Global vs. US) and PSP/ZDR support for API credentials
  • Support for quota forecast, account tags/weights, pause/drain policies, and a real-time web dashboard

Related

  • Project
  • Project
  • Project
  • Project
  • Project