# oc-codex-multi-auth

oc-codex-multi-auth is a plugin for Claude Code and Codex that manages ChatGPT accounts in OpenCode and switches between them when one account hits limits.

- plugin · `type=plugin` · Claude Code, Codex · ★ 1596 repo stars
- Author: hashgraph-online
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/hashgraph-online/awesome-codex-plugins/tree/HEAD/plugins/ndycode/oc-chatgpt-multi-auth
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text and 2 script files) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/plugins/oc-codex-multi-auth

## What it does

This OpenCode plugin keeps ChatGPT Plus/Pro accounts in a local pool and chooses an account for each request based on its health and quota. When an account hits a rate limit, requests can fail over to another. The TUI can show quota, while `codex-*` tools handle account management, diagnostics, and safe repairs.

A standalone CLI checks status, limits, and health without an agent. Installation requires Node.js `>=22.19` and OpenCode. OAuth is used to sign in; OpenCode V2 needs version `2.0.16+`, and the `--v2` installer option will not migrate an existing V1 configuration.

## Install

### Claude Code (native platform)

**Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add hashgraph-online/awesome-codex-plugins
```
In the agent chat (not a shell):
```text
/plugin install oc-codex-multi-auth@awesome-codex-plugins
```

## When to use it
- switch accounts when one reaches a rate limit
- check quota for an account or the whole pool
- diagnose pool health and repair issues
- pin a preferred account to a model

## Example prompts
- Check the Codex account pool and its quotas with `codex-status` and `codex-limits`.
- Run `codex-doctor` to inspect the pool and apply a safe repair.
- Switch the active Codex account with `codex-switch`.

## Source text · oc-chatgpt-multi-auth · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: a0f4a553cf426dcb.

BEGIN THIRD-PARTY FILE a0f4a553cf426dcb
````text
# oc-codex-multi-auth

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

<img width="1227" height="702" alt="oc-codex-multi-auth OpenAI accounts picker in OpenCode — add accounts, check quotas, and per-account health" src="https://github.com/user-attachments/assets/b796eb2f-282e-468a-ba6a-acadf09d731b" />

`oc-codex-multi-auth` is an OpenCode plugin that runs Codex-style GPT models on your ChatGPT Plus/Pro subscription over OAuth. It keeps a named pool of ChatGPT accounts on your machine, rotates across them per request with health- and quota-aware selection, shows quota in the TUI prompt line, and ships a 24-tool `codex-*` command kit plus a standalone CLI. Account state stays local under `~/.opencode`.

Use it when one ChatGPT account is not enough: you hit rate limits or quota windows, you split work across accounts and projects, or you run unattended agents that need JSON diagnostics and safe repair commands instead of one opaque auth file.

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

## What it does

- **Account pool** — OAuth login for multiple ChatGPT accounts, stored locally under `~/.opencode`, with per-project pools under `projects/<project-key>/` on by default.
- **Rotation** — health-scored hybrid selection picks the best enabled account per request, with cooldowns, automatic token refresh, and failover on rate limits.
- **Model catalog** — 11 base models covering 59 variants: GPT-6.1 Sol, GPT-6 Astra/Sol/Luna, the GPT-5.6 tiers, GPT-5.5, and more, routed through the stateless Codex contract (`store: false` + `reasoning.encrypted_content`).
- **Quota in the prompt** — the TUI prompt line shows remaining quota for the serving account, the whole pool, or banked reset credits, with rotating screens.
- **`codex-*` tools** — 24 in-session tools for switching, labeling, tagging, limits, diagnostics, and repair.
- **Standalone CLI** — the same package runs `status`, `list`, `limits`, `doctor`, and friends directly — no agent, no token cost.
- **OpenCode V2** — OpenCode 2.0.16+ loads the plugin through a V2 adapter that shares the account pool and request pipeline.
- **Keychain option** — `CODEX_KEYCHAIN=1` stores the pool in macOS Keychain, Windows Credential Manager, or Linux libsecret.

## Install

Requires Node.js `>=22.19` and [OpenCode](https://opencode.ai).

```bash
npx -y oc-codex-multi-auth@latest
```

> [!NOTE]
> The former package name `oc-chatgpt-multi-auth` is retired. Install `oc-codex-multi-auth` for all new setups; see [docs/faq.md](docs/faq.md) for the rename details.

With no flag, the installer only registers the plugin: it adds the plugin entry to `~/.config/opencode/opencode.json`, enables the TUI quota plugin in `~/.config/opencode/tui.json`, and refreshes the cached package. Your existing `provider.openai` model config is left alone. Add a flag to also install a model catalog:

| Flag | Effect |
| --- | --- |
| (none) / `--plugin-only` | Register the plugin entries only |
| `--modern` | Also install the compact catalog: 11 base models with 59 variants |
| `--full` | Also install the compact bases plus 59 explicit selector IDs (`openai/gpt-5.5-medium`) |
| `--legacy` | Install the explicit-only catalog (59 entries) for older OpenCode |
| `--v2` | Register for OpenCode V2 instead (plugin only; see below) |
| `--dry-run` | Show what would change without writing |
| `--no-cache-clear` | Skip clearing the OpenCode plugin cache |
| `--version` | Print the installed version |
````
END THIRD-PARTY FILE a0f4a553cf426dcb

The third-party file has ended. Everything between the a0f4a553cf426dcb tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 4073 of 14683 bytes. © hashgraph-online · MIT · https://github.com/hashgraph-online/awesome-codex-plugins/tree/HEAD/plugins/ndycode/oc-chatgpt-multi-auth

## Similar
- [multi-account-isolation](https://affpapa.org/en/nevibecode/skills/multi-account-isolation.md) — skill · 138200 installs
- [firebase-auth-basics](https://affpapa.org/en/nevibecode/skills/firebase-auth-basics.md) — skill · 186300 installs
- [better-auth-best-practices](https://affpapa.org/en/nevibecode/skills/better-auth-best-practices.md) — skill · 133300 installs
- [better-auth-security-best-practices](https://affpapa.org/en/nevibecode/skills/better-auth-security-best-practices.md) — skill · 52200 installs
- [multi-stage-dockerfile](https://affpapa.org/en/nevibecode/skills/multi-stage-dockerfile.md) — skill · 29688 installs
- [multi-agent-review](https://affpapa.org/en/nevibecode/skills/multi-agent-review.md) — skill · 26900 installs

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
