Skip to content

V2: switching an existing session from ChatGPT Codex OAuth to an OpenAI API key keeps the Codex endpoint #45334

Description

@major

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

  1. Connect a ChatGPT account through the ChatGPT Codex OAuth flow.
  2. Start a session with an OpenAI model that routes through Codex.
  3. Add or activate an OpenAI API-key account.
  4. In the same session, send the next prompt.
  5. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions