Skip to content

Older API keys not supported #6133

@binarybana

Description

@binarybana

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues related to authentication and accountsbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions