anomalyco / anomalyco/opencode
V2: switching an existing session from ChatGPT Codex OAuth to an OpenAI API key keeps the Codex endpoint
@kitlangton is already working on this.
Since Aug 26, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
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/codexand 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.