Registry / auth-security / opencode-openai-codex-auth

opencode-openai-codex-auth

JSON →
library4.4.0jsnpmunverified

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.

npm install opencode-openai-codex-auth
INSTALL
IMPORT
SIG · OPENCODE-OPENAI-CO
O
opencode-openai-codex-auth
auth-securityjavascriptv4.4.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OpenAICodexAuthPlugin
import { OpenAICodexAuthPlugin } from 'opencode-openai-codex-auth';
While this package ships TypeScript types, its primary interaction method for end-users is via CLI commands (`npx`, `opencode`), not direct programmatic imports. This symbol represents the likely main plugin class for integration within the OpenCode framework itself.
IOpenAICodexAuthOptions
import type { IOpenAICodexAuthOptions } from 'opencode-openai-codex-auth';
This type likely defines the configuration options for the OpenCode OpenAI Codex authentication plugin, used when configuring the plugin within the OpenCode ecosystem or for advanced development. Direct programmatic configuration by end-users is not the primary use case, which focuses on CLI-driven setup.
Installer
import { Installer } from 'opencode-openai-codex-auth/installer';
Although the primary interaction is via `npx` to run the installer script, this path might be used for programmatic interaction with the installer's underlying logic, perhaps for testing or custom setup automation. For typical use, the `npx` command is preferred.

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
Debug
Known issues
breakingThe plugin enforced GPT 5.1 model identifiers, deprecating and removing legacy GPT 5.0 models. Existing configurations using GPT-5.0 model names will break.
fix
Update all configurations to use GPT-5.1 model identifiers. Refer to `config/full-opencode.json` for the officially supported configuration structure.
affects: >=3.3.0
breakingVersion 4.0.0 migrated all GPT-5.0 models to GPT-5.1. This change requires users to update their model references in configurations and commands.
fix
Switch all references from `gpt-5.0` to `gpt-5.1` in your OpenCode commands and configurations, specifically updating model presets.
affects: >=4.0.0
gotchaCodex variants (Codex, Codex Max, Codex Mini) do NOT support `reasoning_effort: "none"`. Attempting to set this will auto-convert it to 'low' for Codex/Codex Max, or 'medium' for Codex Mini.
fix
Avoid setting `reasoning_effort: "none"` for Codex variants. If faster responses are desired, use other reasoning effort levels or non-Codex GPT models that support 'none'.
affects: >=4.1.1
gotchaThis plugin is strictly for personal development use with your own ChatGPT Plus/Pro subscription. It is not intended for production or multi-user applications.
fix
For production or multi-user applications, utilize the official OpenAI Platform API directly instead of this plugin to ensure proper scalability and credential management.
affects: >=1.0.0
Errors
Common errors & fixes
Invalid JSON response
The `/agent create` command failed due to issues in handling SSE/JSON responses or overly aggressive filtering of tool calls during compaction.
fix
Upgrade to version 4.0.2 or newer, which contains fixes for agent creation failing and correct handling of SSE/JSON responses.
400 errors during summary/compaction requests when OpenCode sends item_reference pointers to server-stored function calls
The plugin was aggressively filtering out `function_call` and `function_call_output` items, even when tools were present, leading to orphaned `function_call_output` errors.
fix
Upgrade to version 4.0.1 or newer. This version fixes the compaction context loss by only filtering orphaned outputs (without matching calls), preserving matched pairs for context.
GitHub API rate limiting when fetching Codex instructions
Frequent requests to GitHub for Codex instructions could trigger API rate limits, causing failures in fetching necessary data.
fix
Upgrade to version 4.0.1 or newer, which includes a fallback mechanism to handle GitHub API rate limiting.
Upgrade
Version history
4.4.0latest on npm
Audit
Dependencies
@opencode-ai/pluginrequiredThis package is an authentication plugin designed to extend the functionality of the OpenCode AI platform.
Agent activity
44 hits · last 30 days
node
40
Bingbot
1
OpenAI (training)
1
Resources
opencode-openai-codex-auth — npm install opencode-openai-codex-auth · libregistry