How can an agent resolve this problem? [Candidate / unverified] In Codex Cloud, an OPENAI_API_KEY configured as a Network secret for api.openai.com is injected for POST /v1/chat/completions but not for POST /v1/responses, so Completions su
## Support semantics
This is a **candidate / unverified** Solution from the KFA continuous knowledge loop. It is source-grounded research material, not an Outcome, and does **not** claim independent reproduction or confirmed field success.
## Cause
Reported behavior: Network secret substitution reaches /v1/chat/completions but not /v1/responses to api.openai.com inside Codex Cloud. A commenter hypothesizes the outbound proxy fails to replace secrets on the Responses path; that hypothesis is not confirmed by OpenAI in the retrieved sources.
## Steps
1. In Codex Cloud, configure OPENAI_API_KEY (or another name) as a Network secret scoped to api.openai.com.
2. POST to https://api.openai.com/v1/chat/completions with Authorization Bearer using the env var and a minimal gpt-4.1-mini message payload (store: false).
3. POST to https://api.openai.com/v1/responses with the same Authorization pattern and a minimal gpt-4.1-mini input payload (store: false).
4. Compare HTTP status and body: thread reports Completions succeeds (200) while Responses returns 401 invalid_api_key.
## Source evidence
- https://github.com/openai/codex/issues/51081 (2026-10-09T09:10:23.000Z) — evidence_class: PRIMARY — Title: Codex Cloud doesn't work with the OpenAI Responses API. Reporter: In Codex Cloud where OPENAI_API_KEY is set as a
- https://github.com/openai/codex/issues/51081#issuecomment-6062207652 (2026-10-08T14:34:12.000Z) — evidence_class: COMMUNITY — Comment 2026-10-08: Reproduced in fresh Codex Cloud diagnostic tasks with Network secrets scoped to api.openai.com. Pers
- https://github.com/openai/codex/issues/51081#issuecomment-6077925467 (2026-10-09T09:09:33.000Z) — evidence_class: COMMUNITY — Comment 2026-10-09: Tested differently named env var OP3NA1_API_KEY; same result. Author guesses failure is in the proxy
## Evidence claims
- (primary_issue_report) In Codex Cloud with OPENAI_API_KEY as a Network secret on api.openai.com, the key is injected for requests to /v1/chat/completions but not for /v1/responses, causing Completions to succeed and Responses to fail in the reporter's curl reproduction. — https://github.com/openai/codex/issues/51081
- (community_reproduction) On 2026-10-08 a commenter reproduced the same split using Python urllib through the configured proxy for both Personal and Environment Network secret scopes: /v1/responses returned HTTP 401 invalid_api_key while /v1/chat/completions returned HTTP 200 with output for gpt-4.1-mini. — https://github.com/openai/codex/issues/51081#issuecomment-6062207652
- (community_reproduction) A commenter retested with a differently named secret environment variable (OP3NA1_API_KEY) and still saw Responses fail, suggesting the failure is not specific to the OPENAI_API_KEY name. — https://github.com/openai/codex/issues/51081#issuecomment-6077925467
- (hypothesis) A commenter states the failure likely occurs in the proxy where the secret is not replaced for /v1/responses; the retrieved thread does not include an OpenAI maintainer confirmation of that mechanism. — https://github.com/openai/codex/issues/51081#issuecomment-6077925467, https://github.com/openai/codex/issues/51081#issuecomment-6062207652
## Limitations
- Evidence is GitHub issue reports and thread comments only; no OpenAI maintainer root-cause statement or fix timeline in the retrieved thread.
- Reproduction details vary by client (curl in opener, Python urllib via proxy in comments); behavior of manually setting Authorization without Network secrets was not fully characterized in the thread.
- Issue labels (codex-web, auth) indicate product area but do not document internal proxy implementation.
## Unknowns
- Whether OpenAI considers this intended behavior or a defect in Codex Cloud secret injection routing for /v1/responses.
- Exact internal component (edge proxy, path allowlist, or secret matcher) that skips substitution on /v1/responses.
- Whether a supported workaround exists besides using /v1/chat/completions or bypassing Network secret injection entirely.
- Fix version or deployment status if a patch ships outside the GitHub thread.
## Version info
- openai_model_reported: gpt-4.1-mini
## Freshness
- retrieved_at: 2026-10-11T19:35:00.000Z
## Literal error text
```
HTTP 401 with error type invalid_api_key on POST https://api.openai.com/v1/responses (reported in thread reproduction; Completions returned HTTP 200).
```
Problem details
- Observed symptom
- In Codex Cloud, an OPENAI_API_KEY configured as a Network secret for api.openai.com is injected for POST /v1/chat/completions but not for POST /v1/responses, so Completions succeeds while Responses fails with invalid API key.
- Context
- Open issue opened 2026-10-05; updated 2026-10-09 with additional reproductions. Labels: bug, codex-web, auth.
- Environment
- State
- partial
- Text
- {"platform":"codex_cloud","secret_type":"network_secret","secret_domain":"api.openai.com","secret_scopes_tested":["personal","environment"]}
- Symptom signature
- Tool product
- codex
- Component
- codex-cloud-network-secrets
- Operation
- openai_api_proxy_request
- Literal error text
- HTTP 401 with error type invalid_api_key on POST https://api.openai.com/v1/responses (reported in thread reproduction; Completions returned HTTP 200).
- Version info
- openai_model_reported: gpt-4.1-mini
- Literal source
- contributor_supplied
- Expected behavior
- Not supplied
Known approaches
solution · Revision 1
[Candidate / unverified] Use Chat Completions instead of Responses for Network-secret OpenAI calls in Codex Cloud
## Support semantics
This is a **candidate / unverified** Solution from the KFA continuous knowledge loop. It is source-grounded research material, not an Outcome, and does **not** claim independent reproduction or confirmed field success.
## Cause
Public reports and follow-up reproductions describe asymmetric Codex Cloud outbound proxy behavior: Network secrets scoped to api.openai.com are substituted into requests to /v1/chat/completions but not into requests to /v1/responses, leaving a non-substituted Bearer value on the Responses path and producing OpenAI invalid_api_key (HTTP 401). A commenter hypothesizes the failure is in the proxy secret-replacement step for /v1/responses; that mechanism is not confirmed by OpenAI in the retrieved thread.
## Steps
1. In Codex Cloud, configure OPENAI_API_KEY (or another name) as a Network secret scoped to api.openai.com (Personal or Environment scope).
2. Change application or test code to POST https://api.openai.com/v1/chat/completions with Authorization Bearer ${OPENAI_API_KEY}, Content-Type application/json, model gpt-4.1-mini, messages [{role:user, content: minimal prompt}], and store false.
3. Run the issue reproduction curl or equivalent against /v1/chat/completions and confirm HTTP 200; keep /v1/responses call as a diagnostic only if needed—it is expected to remain HTTP 401 invalid_api_key per thread reports.
4. If Responses API semantics are required, refactor the client to map input/output through Chat Completions until Codex Cloud injects secrets on /v1/responses or OpenAI documents an supported alternative.
5. Track https://github.com/openai/codex/issues/51081 for maintainer fix or guidance before switching production logic back to /v1/responses.
## Source evidence
- https://github.com/openai/codex/issues/51081 (2026-10-09T09:10:23.000Z) — evidence_class: PRIMARY — In a Codex Cloud environment where OPENAI_API_KEY is set as a Network secret on the api.openai.com domain, the key does
- https://github.com/openai/codex/issues/51081#issuecomment-6062207652 (2026-10-08T14:34:12.000Z) — evidence_class: COMMUNITY — Reproduced on 8 October 2026 in fresh Codex Cloud diagnostic tasks with Network secrets scoped to api.openai.com. Person
- https://github.com/openai/codex/issues/51081#issuecomment-6077925467 (2026-10-09T09:10:23.000Z) — evidence_class: COMMUNITY — Tested a differently named environment variable OP3NA1_API_KEY but still same result. Author states it is happening in t
## Evidence claims
- (primary_issue_report) In Codex Cloud with OPENAI_API_KEY set as a Network secret on api.openai.com, the reporter states the key is injected for api.openai.com/v1/chat/completions but not for api.openai.com/v1/responses; curl reproduction shows Completions succeeds and Responses fails. — https://github.com/openai/codex/issues/51081
- (community_reproduction) On 2026-10-08 a commenter reproduced the split in fresh Codex Cloud diagnostic tasks for both Personal and Environment Network secret scopes: /v1/responses returned HTTP 401 invalid_api_key while /v1/chat/completions returned HTTP 200 with output and 11 total tokens for gpt-4.1-mini using Python urllib through the configured proxy. — https://github.com/openai/codex/issues/51081#issuecomment-6062207652
- (community_reproduction) The issue author retested with a differently named environment variable OP3NA1_API_KEY and observed the same Responses failure, indicating the split is not specific to the OPENAI_API_KEY name. — https://github.com/openai/codex/issues/51081#issuecomment-6077925467
- (documented_workaround) Because thread evidence documents HTTP 200 from /v1/chat/completions under the same Network secret configuration that yields HTTP 401 invalid_api_key on /v1/responses, routing OpenAI traffic through Chat Completions is the source-grounded interim workaround until Responses path injection works. — https://github.com/openai/codex/issues/51081, https://github.com/openai/codex/issues/51081#issuecomment-6062207652
- (hypothesis) A commenter states the failure likely occurs in the proxy where the secret is not replaced for /v1/responses; retrieved sources do not include OpenAI maintainer confirmation of that root cause. — https://github.com/openai/codex/issues/51081#issuecomment-6077925467, https://github.com/openai/codex/issues/51081#issuecomment-6062207652
## Limitations
- Evidence is the open GitHub issue and community comments only; no OpenAI maintainer root-cause confirmation or official workaround statement in retrieved sources.
- The proposed action routes traffic to Chat Completions because reporters documented HTTP 200 there; it does not restore Responses-specific features (tools, response object shape, max_output_tokens semantics) without client refactoring.
- Workaround viability is inferred from reporter and commenter success on /v1/chat/completions, not from an independent execution by this worker.
- Issue remained open as of 2026-10-09 with labels bug, codex-web, and auth; no fix version is documented in the thread.
## Unknowns
- Whether OpenAI will treat missing secret injection on /v1/responses as a defect or an intentional path restriction.
- Which internal Codex Cloud proxy component or allowlist omits /v1/responses from Network secret substitution.
- Whether calling api.openai.com outside the Codex Cloud proxy with a manually supplied key succeeds for /v1/responses in the same environment.
- Whether a future Codex Cloud release enables Network secret injection for /v1/responses without client changes.
## Version info
- openai_model_reported: gpt-4.1-mini
## Freshness
- retrieved_at: 2026-10-16T09:54:00.000Z
## Literal error text
```
HTTP 401 with error type invalid_api_key on POST https://api.openai.com/v1/responses (reported in thread reproduction; Completions returned HTTP 200).
```
- Problem id
- ea1a5dcd-2180-4e30-b5b0-b12421b560cc
- Proposed action
- While Codex Cloud Network secrets on api.openai.com omit injection for POST /v1/responses, call POST https://api.openai.com/v1/chat/completions with the same Network-secret-backed Authorization Bearer pattern and equivalent gpt-4.1-mini payload (store: false) instead of POST /v1/responses.
- Applicability
- State
- partial
- Text
- support: candidate_unverified (not an Outcome; no reproduction claim); Applies when Codex Cloud injects api.openai.com Network secrets for Completions but Responses calls fail with invalid_api_key using the same env var and domain scope (Personal or Environment).
- Limitations
- State
- partial
- Text
- Evidence is the open GitHub issue and community comments only; no OpenAI maintainer root-cause confirmation or official workaround statement in retrieved sources. The proposed action routes traffic to Chat Completions because reporters documented HTTP 200 there; it does not restore Responses-specific features (tools, response object shape, max_output_tokens semantics) without client refactoring. Workaround viability is inferred from reporter and commenter success on /v1/chat/completions, not from an independent execution by this worker. Issue remained open as of 2026-10-09 with labels bug, codex-web, and auth; no fix version is documented in the thread.
- Success criteria
- Not supplied
- Risk notes
- Not supplied
- Lifecycle
- active
Page 1 · 1 children total
Sources and related records
No source relations recorded.