api key bach not working

Resolved 💬 5 comments Opened Oct 1, 2025 by firmai Closed Dec 10, 2025

What version of Codex is running?

latest

Which model were you using?

_No response_

What platform is your computer?

_No response_

What steps can reproduce the bug?

%%bash

Always grab latest Codex

npm install -g @openai/codex@latest

✅ API key authentication (fake)

export OPENAI_API_KEY="sk-proj-8Dvo0_nGTvHe6fffWX8xb5HhX5s5MHBLPlfEbc22uxKkdLs8A"

Quick smoke test (should not 401)

codex exec --full-auto --skip-git-repo-check --config preferred_auth_method="apikey" "echo Codex API auth OK"

anged 1 package in 3s
[2025-10-01T15:36:50] OpenAI Codex v0.42.0 (research preview)
--------
workdir: /content
model: gpt-5-codex
provider: openai
approval: never
sandbox: workspace-write [workdir, /tmp, $TMPDIR]
reasoning effort: none
reasoning summaries: auto
--------
[2025-10-01T15:36:50] User instructions:
echo Codex auth OK
[2025-10-01T15:36:54] stream error: exceeded retry limit, last status: 401 Unauthorized; retrying 1/5 in 208ms…
[2025-10-01T15:36:58] stream error: exceeded retry limit, last status: 401 Unauthorized; retrying 2/5 in 420ms…
[2025-10-01T15:37:02] stream error: exceeded retry limit, last status: 401 Unauthorized; retrying 3/5 in 776ms…
[2025-10-01T15:37:06] stream error: exceeded retry limit, last status: 401 Unauthorized; retrying 4/5 in 1.546s…
[2025-10-01T15:37:11] stream error: exceeded retry limit, last status: 401 Unauthorized; retrying 5/5 in 3.374s…
[2025-10-01T15:37:18] ERROR: exceeded retry limit, last status: 401 Unauthorized
[2025-10-01T15:37:18] OpenAI Codex v0.42.0 (research preview)
--------
workdir: /content
model: gpt-5-codex
provider: openai
approval: never
sandbox: workspace-write [workdir, /tmp, $TMPDIR]
reasoning effort: none
reasoning summaries: auto
--------
[2025-10-01T15:37:18] User instructions:
Extract and analyze fake made up contents. Produce an HTML report with 4 creative visualizations. Save to summary_visuals.html.
[2025-10-01T15:37:21] stream error: exceeded retry limit, last status: 401 Unauthorized; retrying 1/5 in 185ms…
[2025-10-01T15:37:25] stream error: exceeded retry limit, last status: 401 Unauthorized; retrying 2/5 in 396ms…
[2025-10-01T15:37:29] stream error: exceeded retry limit, last status: 401 Unauthorized; retrying 3/5 in 801ms…
[2025-10-01T15:37:33] stream error: exceeded retry limit, last status: 401 Unauthorized; retrying 4/5 in 1.577s…
[2025-10-01T15:37:38] stream error: exceeded retry limit, last status: 401 Unauthorized; retrying 5/5 in 3.2s…
[2025-10-01T15:37:45] ERROR: exceeded retry limit, last status: 401 Unauthorized

What is the expected behavior?

_No response_

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗