Older API keys not supported

Resolved 💬 2 comments Opened Nov 3, 2025 by binarybana Closed Dec 10, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.53.0

What subscription do you have?

None (API key)

Which model were you using?

gpt-5-codex

What platform is your computer?

WSL2 - ubuntu 24.04

What issue are you seeing?

I was trying to use an API key generated in Oct 2024, but kept getting retry timeouts (421 not authorized). But I know the key works for other requests.

The only way I could get it to work was to generate a new key with the same permissions ("all") as the old one.

What steps can reproduce the bug?

Use a key generated from a year ago that looks roughly like this

``sk-qW0XXXXXXXXXXXXXXXm``

/logout from within Codex, and then launch codex and login with your api key. (Confirm it got entered correctly at ~/.codex/auth.json.

Then codex e test and get Retry 5/5 421 unauthorized (forgot to grab the actual text but that's the gist of it).

Then do the same with a new key of the format below

sk-proj-XXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx7MA```

And get the expected behavior of a working codex prompt.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 9 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #6096
  • #6042
  • #5951
  • #5667
  • #5456

Powered by Codex Action

etraut-openai contributor · 8 months ago

Please update to a newer API key.