Codex 401, token_expired or refresh_token_reused: what to do
Sign in again on desktop, IDE or CLI to handle 401 and expired-token errors.
Start here
Save your work, sign out and sign back in, then send a short test. If only one plugin fails, reauthorize that connection first.
On this page
1. Identify the failing connection
- If ordinary chats also show 401, token_expired or refresh_token_reused, follow the sign-in steps below.
- If only a plugin or app fails, reauthorize it in its connection settings. For API-key or organization sign-in, check the key or ask the administrator.
2. CLI: use a regular terminal
- Save your work and run the commands below one at a time in PowerShell or Terminal.
- Authorize the original account in the browser, wait for success in the terminal, then run codex.
codex login status
codex logout
codex login
codex login status3. Desktop or IDE: use the account menu
- Open the profile or account menu and select Log out.
- Choose Sign in with ChatGPT, authorize the original account in the browser, then return to the client.
4. Send a short test
- Start a new chat and send “Reply only OK, without using tools.” Continue the original task after a reply.
- If the client keeps waiting or localhost fails after browser authorization, use the callback guide.
5. Contact support
- Provide the client version, sign-in method and error screenshot after signing in again.
- Keep just the tested client open and tell support whether other clients also fail.