Description
incorrectly binds the OpenAI provider to the OpenCode Zen integration, causing a Zen API key to be sent to ChatGPT’s OAuth-only Codex endpoint. OpenAI rejects the key with “API keys are not supported by this endpoint.” The correct OpenAI OAuth credential works when restored at request time.
ChatGPT OAuth login succeeds and stores a valid token, but OpenAI model requests fail with:
API keys are not supported by this endpoint.
The request goes to the correct ChatGPT Codex endpoint and includes the correct chatgpt-account-id, but its Authorization header contains the OpenCode Zen API key instead of the OpenAI OAuth token.
Re-authenticating with OpenAI does not help. This began without any local configuration changes.
Expected: requests routed to the ChatGPT Codex endpoint use the credential from the openai integration.
Plugins
No response
OpenCode version
2.0.8
Steps to reproduce
- Have an OpenCode Zen credential configured.
- Run opencode auth login openai and complete ChatGPT OAuth in the browser.
- Run:
opencode run --model openai/gpt-5.6-luna "hi"
- Observe:
API keys are not supported by this endpoint.
The outgoing request targets:
https://chatgpt.com/backend-api/codex/responses
but uses the Zen API key in Authorization rather than the ChatGPT OAuth token.
Screenshot and/or share link
No response
Operating System
macOS 25.5.0
Terminal
Ghostty
Description
incorrectly binds the OpenAI provider to the OpenCode Zen integration, causing a Zen API key to be sent to ChatGPT’s OAuth-only Codex endpoint. OpenAI rejects the key with “API keys are not supported by this endpoint.” The correct OpenAI OAuth credential works when restored at request time.
ChatGPT OAuth login succeeds and stores a valid token, but OpenAI model requests fail with:
The request goes to the correct ChatGPT Codex endpoint and includes the correct chatgpt-account-id, but its Authorization header contains the OpenCode Zen API key instead of the OpenAI OAuth token.
Re-authenticating with OpenAI does not help. This began without any local configuration changes.
Expected: requests routed to the ChatGPT Codex endpoint use the credential from the openai integration.
Plugins
No response
OpenCode version
2.0.8
Steps to reproduce
opencode run --model openai/gpt-5.6-luna "hi"
API keys are not supported by this endpoint.
The outgoing request targets:
https://chatgpt.com/backend-api/codex/responses
but uses the Zen API key in Authorization rather than the ChatGPT OAuth token.
Screenshot and/or share link
No response
Operating System
macOS 25.5.0
Terminal
Ghostty