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

oc-chatgpt-multi-auth

v5.4.9

Published

OpenCode plugin for using ChatGPT Plus/Pro in GPT-5 and Codex workflows with OAuth login, multi-account rotation, and guided setup

Readme

oc-chatgpt-multi-auth

npm version npm downloads License: MIT

Use your ChatGPT Plus/Pro subscription inside OpenCode with OAuth login, GPT-5/Codex model presets, and multi-account failover.

oc-chatgpt-multi-auth is an OpenCode plugin for developers who want ChatGPT-backed GPT-5 and Codex workflows in OpenCode without switching to separate Platform API credentials for personal use. It uses the same official OAuth flow as the Codex CLI, adds model templates for current GPT-5 families, and can rotate across multiple ChatGPT accounts when one account is rate-limited or unavailable.

What This Project Does

  • Adds an OpenCode plugin that authenticates with ChatGPT Plus/Pro through official OAuth
  • Ships ready-to-use model templates for gpt-5.4, gpt-5-codex, and related GPT-5 families
  • Routes requests through a stateless Codex-compatible request pipeline with automatic token refresh
  • Supports multi-account rotation, per-project account storage, and guided onboarding commands

Quick Start

# 1. Install or refresh the plugin config
npx -y oc-chatgpt-multi-auth@latest

# 2. Sign in with ChatGPT Plus/Pro
opencode auth login

# 3. Run a prompt in OpenCode
opencode run "Explain this repository" --model=openai/gpt-5.4 --variant=medium

What the installer does:

  • writes ~/.config/opencode/opencode.json
  • backs up an existing config before changing it
  • normalizes the plugin entry to "oc-chatgpt-multi-auth"
  • clears the cached plugin copy so OpenCode reinstalls the latest package

By default, the installer now writes a full catalog config that includes both:

  • modern base model entries such as gpt-5.4 for --variant workflows
  • explicit preset entries such as gpt-5.4-high so the shipped catalog is visible directly in model pickers

Example Usage

# General GPT-5 workflow
opencode run "Summarize the failing test and suggest a fix" --model=openai/gpt-5.4 --variant=medium

# Codex-focused workflow
opencode run "Refactor the retry logic and update the tests" --model=openai/gpt-5-codex --variant=high

Usage Notice

[!CAUTION] This project is for personal development use with your own ChatGPT Plus/Pro subscription.

  • It is not intended for commercial resale, shared multi-user access, or production services.
  • It uses official OAuth authentication, but it is an independent open-source project and is not affiliated with OpenAI.
  • For production applications, use the OpenAI Platform API.
  • You are responsible for complying with OpenAI's Terms of Use.

Why This Exists

OpenCode users often want the same GPT-5 and Codex model experience they use in ChatGPT, but inside a local terminal workflow. This plugin exists to bridge that gap cleanly:

  • official OAuth instead of scraped cookies or unofficial auth flows
  • OpenCode-ready model definitions instead of hand-rolled config every time
  • account rotation and recovery features for people who work across multiple ChatGPT accounts or workspaces

Features

  • Official OAuth login flow compatible with ChatGPT Plus/Pro access
  • GPT-5 and Codex model templates for modern and legacy OpenCode versions
  • Multi-account rotation with health-aware failover
  • Per-project account storage support
  • Beginner-focused commands such as codex-setup, codex-help, codex-doctor, and codex-next
  • Interactive account switching, labeling, tagging, and backup/import commands
  • Stateless request handling with reasoning.encrypted_content for multi-turn sessions
  • Request logging and troubleshooting hooks for debugging OpenCode integration issues

Common Workflows

  • Personal coding sessions in OpenCode using gpt-5.4 or gpt-5-codex
  • Switching between personal and workspace-linked ChatGPT accounts
  • Keeping separate account pools per project or monorepo
  • Recovering from unsupported-model, auth, or rate-limit issues with guided commands

How It Works

The plugin sits between OpenCode and the ChatGPT-backed Codex workflow:

  1. OpenCode loads the plugin and sends model requests through the plugin fetch pipeline.
  2. The plugin authenticates with ChatGPT OAuth and refreshes tokens when needed.
  3. Requests are normalized for the Codex backend and sent with store: false.
  4. The plugin chooses the best account/workspace candidate, retries intelligently, and preserves conversation continuity through encrypted reasoning state.

See Architecture for implementation details.

Installation

Use the quick-start path above for the fastest setup. For full setup, local development installs, legacy OpenCode support, and verification steps, see Getting Started.

If you prefer the compact variant-only config on OpenCode v1.0.210+, use:

npx -y oc-chatgpt-multi-auth@latest --modern

Configuration

Detailed configuration lives outside this README:

Troubleshooting

Start here if the plugin does not load or authenticate correctly:

Common first checks:

  • confirm "plugin": ["oc-chatgpt-multi-auth"] is present in your OpenCode config
  • rerun opencode auth login
  • inspect ~/.opencode/logs/codex-plugin/ after running one request with ENABLE_PLUGIN_REQUEST_LOGGING=1

FAQ

Short answers for the most common questions live in docs/faq.md, including:

  • who this plugin is for
  • which OpenCode versions it supports
  • how the modern and legacy config templates differ
  • when to use this plugin versus the OpenAI Platform API

Contributing

Contributions are welcome if they keep the project accurate, maintainable, and aligned with its personal-use scope.

License

MIT. See LICENSE.

ChatGPT, GPT-5, Codex, and OpenAI are trademarks of OpenAI, L.L.C.