Older API keys not supported

Resolved 💬 2 comments Opened Nov 3, 2025 by binarybana Closed Dec 10, 2025

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 ↗

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