npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-openai-codex-multi-auth

v4.5.24

Published

OpenAI ChatGPT (Codex backend) OAuth auth plugin for opencode - use your ChatGPT Plus/Pro subscription instead of API credits

Readme

Image 1: opencode-openai-codex-auth

Fork maintained by iam-brain.

Upstream project (credit): numman-ali/opencode-openai-codex-auth

CI npm version

One install. Every Codex model. Multi-account aware. Install · Models · Configuration · Docs

NOTE:

Currently, the CLI (opencode auth login) path does not work correctly due to a possibly unintentional bug in how Opencode handles provider logins in their CLI. The TUI (opencode > ctrl + x m > ctrl + a, OpenAI) path works perfectly as it functions as intended.

Related issue: Issue #10898

Related PRs: Pull #11058 // Pull #11076


💡 Philosophy

"One config. Every model." OpenCode should feel effortless. This plugin keeps the setup minimal while giving you full GPT‑5.x + Codex access via ChatGPT OAuth.

┌─────────────────────────────────────────────────────────┐
│                                                         │
│  ChatGPT OAuth → Codex backend → OpenCode               │
│  One command install, full model presets, done.         │
│                                                         │
└─────────────────────────────────────────────────────────┘

🚀 Quick Start

npx -y opencode-openai-codex-multi-auth@latest

Then:

opencode auth login
opencode run "write hello world to test.txt" --model=openai/gpt-5.2 --variant=medium

Legacy OpenCode (v1.0.209 and below):

npx -y opencode-openai-codex-multi-auth@latest --legacy
opencode run "write hello world to test.txt" --model=openai/gpt-5.2-medium

Uninstall:

npx -y opencode-openai-codex-multi-auth@latest --uninstall
npx -y opencode-openai-codex-multi-auth@latest --uninstall --all

⚠️ Migration Note (Multi-Plan Accounts)

If you used multiple plans or emails under the same ChatGPT accountId on older versions, the previous matching logic could overwrite entries. To regenerate a clean layout:

rm ~/.config/opencode/openai-codex-accounts.json
opencode auth login

📦 Models

  • gpt-5.2 (none/low/medium/high/xhigh)
  • gpt-5.2-codex (low/medium/high/xhigh)
  • gpt-5.1-codex-max (low/medium/high/xhigh)
  • gpt-5.1-codex (low/medium/high)
  • gpt-5.1-codex-mini (medium/high)
  • gpt-5.1 (none/low/medium/high)

🧩 Configuration

  • Modern (OpenCode v1.0.210+): config/opencode-modern.json
  • Legacy (OpenCode v1.0.209 and below): config/opencode-legacy.json

Minimal configs are not supported for GPT‑5.x; use the full configs above.

⌨️ Slash Commands (TUI)

In the OpenCode TUI, you can use these commands to manage your accounts and monitor usage:

| Command | Description | |---------|-------------| | /codex-status | Shows current rate limits (5h/Weekly), credits, and account status (percent left). | | /codex-switch-accounts <index> | Switch the active account by its 1-based index from the status list. | | /codex-toggle-account <index> | Enable or disable an account by its 1-based index (prevents auto-selection). |


✅ Features

  • ChatGPT Plus/Pro OAuth authentication (official flow)
  • 22 model presets across GPT‑5.2 / GPT‑5.2 Codex / GPT‑5.1 families
  • Variant system support (v1.0.210+) + legacy presets
  • Multimodal input enabled for all models
  • Usage‑aware errors + automatic token refresh
  • Multi-account support with sticky selection + PID offset (great for parallel agents)
  • Account enable/disable management (via opencode auth login manage)
  • Strict account identity matching (accountId + email + plan)
  • Hybrid account selection strategy (health score + token bucket + LRU bias)
  • Optional round-robin account rotation (maximum throughput)
  • OpenCode TUI toasts + codex-status / codex-switch-accounts tools
  • Authoritative Codex Status: Real-time rate limit monitoring (5h/Weekly) with ASCII status bars

📚 Docs

  • Getting Started: docs/getting-started.md
  • Configuration: docs/configuration.md
  • Multi-Account: docs/multi-account.md
  • Troubleshooting: docs/troubleshooting.md
  • Architecture: docs/development/ARCHITECTURE.md

⚠️ Usage Notice

This plugin is for personal development use with your own ChatGPT Plus/Pro subscription. For production or multi‑user applications, use the OpenAI Platform API.

Credits

  • Original implementation and ongoing upstream work: Numman Ali and contributors (numman-ali/opencode-openai-codex-auth)
  • Multi-account strategy + UX inspiration (rotation modes, PID offset approach, toasts): NoeFabris and contributors (NoeFabris/opencode-antigravity-auth)
  • This fork: multi-account pool, sticky-by-default rotation with PID offset, round-robin option, and account tools/toasts

Built for developers who value simplicity.