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-multi-auth

v5.0.5

Published

OpenAI ChatGPT OAuth plugin for opencode with multi-account rotation on rate limits

Readme

Image 1: opencode-openai-multi-auth

npm version Tests npm downloads

Multi-Account ChatGPT OAuth for OpenCode

Use multiple ChatGPT Plus/Pro personal or organization accounts with OpenCode. Never hit rate limits again.

┌────────────────────────────────────────────────────────────────┐
│                                                                │
│   Account 1 (rate limited) ──┐                                 │
│   Account 2 (rate limited) ──┼──► Auto-rotate ──► Keep coding  │
│   Account 3 (available) ─────┘                                 │
│                                                                │
└────────────────────────────────────────────────────────────────┘

Why Multi-Account?

| Problem | Solution | |---------|----------| | Hit ChatGPT rate limits while coding | Add multiple accounts, auto-rotate when limited | | Team members share one subscription | Each person adds their own account | | Different orgs have separate subscriptions | Use accounts from multiple organizations | | One account gets throttled | Seamlessly switch to next available account |


Quick Start

# Install
npx -y opencode-openai-multi-auth@latest

# Add your first account
opencode auth login
# Select "ChatGPT Plus/Pro (Codex Subscription)"

# Add more accounts (optional but recommended)
opencode auth login
# Select "Add Another OpenAI Account"

# Start coding - accounts rotate automatically on rate limits
opencode run "write hello world to test.txt" --model=openai/gpt-5.2 --variant=medium

How Multi-Account Works

Adding Accounts

# First account
opencode auth login
# → Select "ChatGPT Plus/Pro (Codex Subscription)"
# → Browser opens, login with ChatGPT
# → Account saved

# Second account (different email/org)
opencode auth login
# → Select "Add Another OpenAI Account"
# → Login with different ChatGPT account
# → Account added to rotation pool

# Repeat for as many accounts as you have

Automatic Rotation

When you hit a rate limit:

  1. Plugin detects 429 (rate limited) response
  2. Marks current account as limited for that model
  3. Switches to next available account
  4. Retries your request automatically
  5. Shows toast notification: Switched to [email protected]

Account Selection Strategies

| Strategy | Behavior | Best For | |----------|----------|----------| | sticky (default) | Stay with one account until rate limited | Single user, predictable usage | | round-robin | Rotate through accounts on each request | Distribute load evenly | | hybrid | Sticky within session, rotate across sessions | Multiple terminal sessions |

Set via environment variable:

OPENCODE_OPENAI_STRATEGY=round-robin opencode run "task"

Team Usage

Each team member can add their own ChatGPT account:

# Developer 1 adds their account
opencode auth login  # logs in as [email protected]

# Developer 2 adds their account  
opencode auth login  # → "Add Another OpenAI Account" → [email protected]

# Developer 3 adds their account
opencode auth login  # → "Add Another OpenAI Account" → [email protected]

All accounts are pooled - when one person's account is rate limited, the plugin uses the next available.


Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | OPENCODE_OPENAI_QUIET=1 | Disable toast notifications | Off | | OPENCODE_OPENAI_DEBUG=1 | Enable debug logging | Off | | OPENCODE_OPENAI_STRATEGY | Account selection strategy | sticky | | OPENCODE_OPENAI_PID_OFFSET=1 | Offset account selection by PID | Off |


Account Management

View Accounts

cat ~/.config/opencode/openai-accounts.json | jq '.accounts[] | {email, planType}'

Remove All Accounts

rm ~/.config/opencode/openai-accounts.json

Check Rate Limit Status

cat ~/.config/opencode/openai-accounts.json | jq '.accounts[] | {email, rateLimitResets}'

Slash Commands (TUI)

/codex-status

Shows usage status for all configured accounts.


Models

All GPT-5.2 and GPT-5.1 models with reasoning variants:

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

Note: The model selector reflects what the ChatGPT OAuth backend advertises. API-only models (like gpt-5-mini/nano) may not appear until the backend exposes them.


Configuration

  • Modern (OpenCode v1.0.210+): config/opencode-modern.json
  • Legacy (v1.0.209 and below): config/opencode-legacy.json
# Modern install
npx -y opencode-openai-multi-auth@latest

# Legacy install
npx -y opencode-openai-multi-auth@latest --legacy

# Uninstall
npx -y opencode-openai-multi-auth@latest --uninstall

Features

  • Multi-account rotation - Add unlimited ChatGPT accounts, auto-rotate on rate limits
  • Per-model rate tracking - Each model's limits tracked separately per account
  • Toast notifications - Visual feedback when accounts switch
  • OAuth authentication - Same secure flow as official Codex CLI
  • 22 model presets - All GPT-5.2/5.1 variants pre-configured
  • Automatic token refresh - Never manually re-authenticate
  • Multimodal support - Image input enabled for all models

Documentation


Credits

Maintained by ZenysTX Original implementation by Numman Ali Inspired by opencode-google-antigravity-auth

Twitter Follow Twitter Follow


Usage Notice

This plugin is for personal development use with your own ChatGPT Plus/Pro subscriptions.