OpenCode OpenAI Codex Authentication Plugin

4.4.0 · active · verified Wed Apr 22

This package provides an authentication plugin for the OpenCode AI platform, enabling users to leverage their existing ChatGPT Plus/Pro subscriptions with the OpenAI Codex backend instead of consuming API credits. The current stable version is 4.4.0, and the project demonstrates a very active release cadence with multiple minor and patch releases in quick succession, indicating ongoing development and maintenance. Key differentiators include a simplified one-command installer (`npx opencode-openai-codex-auth@latest`), comprehensive support for various GPT-5.x and Codex model families (including GPT-5.2 Codex), and an official OAuth flow for seamless integration. It handles multimodal input and automatically manages token refresh, aiming to provide a 'one config, every model' philosophy for OpenCode users. It is designed primarily for personal development use, with a warning against production or multi-user applications.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates the one-command installation and subsequent authentication and model usage with the OpenCode CLI.

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

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

# For 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

view raw JSON →