CortexKit OpenAI Auth lets OpenCode (versions 1 and 2) and Pi use a ChatGPT Plus or Pro subscription through the OpenAI Codex backend, instead of a pay-as-you-go API key. It ships as two packages: @cortexkit/opencode-openai-auth for OpenCode and @cortexkit/pi-openai-auth for Pi.
OpenCode and Pi can already sign in to ChatGPT. This plugin adds:
- Several ChatGPT accounts, with sticky routing that keeps each session on one account instead of rebalancing every turn.
- Prompt-cache keep-warm, so an idle session's next turn still hits the cache.
- Optional Claustrum vault integration: Claustrum is CortexKit's local credential vault, which keeps the logins and refreshes them in one place so no plugin holds a refresh token.
- Usage limits per account, with a killswitch that blocks requests below a chosen minimum remaining quota.
- The plugin's
/openaislash-command menu and a sidebar showing the usage left on each account. - Rate-limit reset credits, previewed and spent from the menu.
- A WebSocket transport, with plain HTTP as the default and fallback.
This plugin is not affiliated with or endorsed by OpenAI. Using a subscription this way may be against OpenAI's terms, and OpenAI may limit or suspend accounts. You use it at your own risk; the authors accept no responsibility for any action the provider takes.
npx @cortexkit/opencode-openai-auth setupThe setup command detects OpenCode and Pi, registers the plugin, and offers a connection to the optional Claustrum vault or local sign-in.
Then start OpenCode and run /openai.
- Configuration: settings, environment variables and manual install.
- Accounts and routing: multiple accounts, routing modes, quota and the killswitch.
- Claustrum vault: what the vault is, connecting OpenCode or Pi, and vault mode.
- Commands: the
/openaimenu, theopencode auth loginmenu and the Pi command. - Cache keep-warm: keeping idle sessions' prompt cache warm.
- OpenCode 2: install and differences from OpenCode 1.
- Transports: HTTP and the WebSocket transports.
- Troubleshooting: logging, request dumps and clearing the plugin cache.
- Development: working on this repository, tests and the mutation catalogue.
- Release: publishing a new version.
MIT