You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
V2: switching an existing session from ChatGPT Codex OAuth to an OpenAI API key keeps the Codex endpoint #45334
I use both ChatGPT Codex OAuth and an OpenAI API key. If I switch the active OpenAI account from ChatGPT Codex OAuth to an API key while an existing session is open, the next prompt keeps using the Codex endpoint and fails with API keys are not supported by this endpoint. I expect the next prompt to use the normal OpenAI API endpoint and the newly active API key, without interrupting the session.
Plugins
opencode-chatgpt-websearch
OpenCode version
0.0.0-dev-18308 when observed, currently 0.0.0-dev-18313
Steps to reproduce
Connect a ChatGPT account through the ChatGPT Codex OAuth flow.
Start a session with an OpenAI model that routes through Codex.
Add or activate an OpenAI API-key account.
In the same session, send the next prompt.
The request still targets https://chatgpt.com/backend-api/codex and fails because it received the API key.
Operating System
Linux 7.1.10-200.fc44.x86_64
Terminal
Alacritty
Additional context
This is distinct from #7699 and #34765. This case is an API-key request retaining the Codex route after an active-account switch in an existing session.
Activity
major commentedon Aug 26, 2026
Working on a PR for this...