Skip to content

gpt-5.3-codex fails with 404 when authenticated via OpenAI API key #12839

@iyoda

Description

@iyoda

Description
When a user authenticates with a standard OpenAI API key via opencode auth login → "Manually enter API Key", gpt-5.3-codex appears as an available model but fails with a 404 error at runtime.
Root Cause
gpt-5.3-codex is only available via the ChatGPT Codex endpoint (chatgpt.com/backend-api/codex/responses), which requires OAuth authentication. It is not listed on the OpenAI API platform.
The codex plugin (src/plugin/codex.ts) rewrites the request URL to the ChatGPT endpoint for OAuth users, but for API key users it returns early without any filtering:
if (auth.type !== "oauth") return {}
This means gpt-5.3-codex (from models.dev) remains in the available model list, but requests go to api.openai.com/v1/responses where the model does not exist → 404.
Note: Other codex models like gpt-5.2-codex are available on the OpenAI API platform and work correctly with API keys.
Steps to Reproduce

  1. Run opencode auth login
  2. Select OpenAI → "Manually enter API Key"
  3. Enter a valid OpenAI API key
  4. Select gpt-5.3-codex as the model
  5. Send a message → 404 error
    Expected Behavior
    gpt-5.3-codex should not appear as available for API key users, or a clear error should explain that OAuth is required.

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