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) ─────┘ │
│ │
└────────────────────────────────────────────────────────────────┘
| 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 |
# 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# 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 haveWhen you hit a rate limit:
- Plugin detects 429 (rate limited) response
- Marks current account as limited for that model
- Switches to next available account
- Retries your request automatically
- Shows toast notification:
Switched to account2@example.com
| 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"Each team member can add their own ChatGPT account:
# Developer 1 adds their account
opencode auth login # logs in as dev1@company.com
# Developer 2 adds their account
opencode auth login # → "Add Another OpenAI Account" → dev2@company.com
# Developer 3 adds their account
opencode auth login # → "Add Another OpenAI Account" → dev3@company.comAll accounts are pooled - when one person's account is rate limited, the plugin uses the next available.
| 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 |
cat ~/.config/opencode/openai-accounts.json | jq '.accounts[] | {email, planType}'rm ~/.config/opencode/openai-accounts.jsoncat ~/.config/opencode/openai-accounts.json | jq '.accounts[] | {email, rateLimitResets}'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)
- 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- 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
Maintained by ZenysTX Original implementation by Numman Ali Inspired by opencode-google-antigravity-auth
This plugin is for personal development use with your own ChatGPT Plus/Pro subscriptions.