Skip to content

Latest commit

 

History

History
105 lines (91 loc) · 4.14 KB

File metadata and controls

105 lines (91 loc) · 4.14 KB

Image 1: opencode-openai-codex-auth

Curated by Numman Ali Twitter Follow npm version Tests npm downloads One install. Every Codex model. Install · Models · Configuration · Docs


💡 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-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-auth@latest --legacy
opencode run "write hello world to test.txt" --model=openai/gpt-5.2-medium

📦 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.

✅ 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 automatic rate limit rotation

👥 Multi-Account Support

Heavy users can configure up to 10 ChatGPT accounts. When one account hits rate limits, the plugin automatically switches to the next available account.

Adding Accounts

During initial login:

opencode auth login
# After first account: "You have 1 account(s). Add another? [y/N]: y"

Add accounts later:

codex-accounts add      # Opens browser OAuth
codex-accounts list     # Show all accounts
codex-accounts remove 1 # Remove account at index 1

How It Works

  1. Request sent using current account
  2. If 429 (rate limit) received, marks account as rate-limited
  3. Automatically retries with next available account (up to 3 retries)
  4. Rate limit state persists across sessions

Storage

Account metadata stored at:

  • Linux/macOS: ~/.local/share/opencode/openai-codex-accounts.json
  • Windows: %APPDATA%/opencode/openai-codex-accounts.json

📚 Docs

  • Getting Started: docs/getting-started.md
  • Configuration: docs/configuration.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.

Built for developers who value simplicity.