Skip to content

feat(ai): openai-codex-responses support use custom apiKey and baseUrl#4667

Open
CyJaySong wants to merge 2 commits into
can1357:mainfrom
CyJaySong:feat/apikey-codex-responses-gateways
Open

feat(ai): openai-codex-responses support use custom apiKey and baseUrl#4667
CyJaySong wants to merge 2 commits into
can1357:mainfrom
CyJaySong:feat/apikey-codex-responses-gateways

Conversation

@CyJaySong

@CyJaySong CyJaySong commented Jul 6, 2026

Copy link
Copy Markdown

What

Add support for API-key based custom providers on the OpenAI Codex Responses path.

This change lets custom openai-codex-responses providers use bearer API keys while preserving the first-party Codex request shape, including Codex-style response metadata, cache-related headers, and the existing OMP originator / User-Agent behavior.

Why

Some Codex-compatible gateways route requests correctly only when the request follows the Codex Responses API contract closely. API-key based custom providers previously could not fully use that path, which made these gateways fall back to unintended model routing.

Testing

  • Ran bun --cwd=packages/ai run check
  • Ran git diff --check
  • Added/updated provider streaming coverage for API-key Codex Responses requests

  • bun check passes
  • Tested locally
  • CHANGELOG updated (if user-facing)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@github-actions github-actions Bot added the vouched Passed the vouch gate label Jul 6, 2026
@roboomp roboomp added auth Authentication and login flows feat provider:openai-codex providers LLM provider-specific issues review:p3 triaged labels Jul 6, 2026

@roboomp roboomp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: the feature is scoped to Codex Responses custom gateways, but the diff is currently broken/off-contract.

Headline blockers: packages/ai changed tests fail (bun --cwd=packages/ai test test/openai-codex-stream.test.ts: 53 pass / 4 fail); the new metadata helper does not implement the project/projectless workspace contract; and the opaque-key beta-header contract is now inconsistent across old and new coverage. Also needs changelog entries for the user-facing packages/ai and packages/coding-agent changes.

Thanks for pushing the gateway path forward; once the failing contracts are reconciled, this should be much easier to judge on the intended behavior.

Comment thread packages/ai/src/providers/openai-codex-responses.ts Outdated
Comment thread packages/ai/src/providers/openai-codex-responses.ts
Comment thread packages/coding-agent/src/config/models-config-schema.ts
@CyJaySong

Copy link
Copy Markdown
Author

@can1357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth Authentication and login flows feat provider:openai-codex providers LLM provider-specific issues review:p3 triaged vouched Passed the vouch gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants