Stream error: exceeded retry limit, last status: 401 Unauthorized with ChatGPT Signin after account migration

I’m experiencing issues with Codex CLI after my account was migrated from Usage Tier 3 to Tier 4. Codex worked previously with my ChatGPT Pro plan, but now only works with api key.

When using Codex CLI after signed in with ChatGPT, I’m getting: - Stream disconnected errors (1/5 retries) - 403 Forbidden on device auth - Only API key works now.

Is this related to the tier migration and how to make ChatGPT OAuth work again with Codex CLI?

Have also tried method below, but does not work.

  1. Shut down vscode/cursor
  2. mv ~/.codex/auth.json ~/.codex/auth.json.bak
  3. Start vscode/cursor back up, and log back in (Select login with ChatGPT, not with API).

One the reasons I’ve seen this happen is when one starts a chat while using API key for auth, then switches to ChatGPT for Auth and tries to continue the same chat.

thanks, I tried logout, and start a new terminal, and login with ChatGPT, but still not working. Any advice?

Can you confirm if it works for another project directory that you didn’t use it for previously?

confirmed also not working

any fix? having same issue.

This should be resolved now! Let me know if you're still seeing these errors.

And sorry for the delay in getting back here, trying to catch up!

1 Like

Still having the same issue, Codex Cli works with API but not with ChatGPT Signin.

Error message: exceeded retry limit, last status: 401 Unauthorized

Ack, thank you for confirming!


This may be the extension holding a stale in-memory token. Can you try:

  • Sign out from the extension UI, fully quit the editor so the extension restarts, then sign back in from the extension UI (not just the CLI).
  • If that fails, rename or delete ~/.codex/auth.json, restart the editor, then sign in via the extension UI and the CLI.
  • If still failing, please share the failing request id(s), timestamps, and any logs you might have access to.
1 Like