Codex

Codex login status error: fix it fast

Fix Codex login and status errors: expired tokens, wrong account, proxy issues, and the difference between an auth failure and a usage limit.

Quick answer

Run `codex login status` to see which account is active. If it reports no session, run `codex login` and complete the browser flow. If it reports a valid session but requests still fail, the problem is usually the network, a proxy, or a usage window rather than authentication.

Tell the errors apart

MessageLikely causeFirst action
Not logged inNo token or expired token`codex login`
Invalid API keyWrong key in envUnset the key or replace it
403 or 429Access or rate limitCheck plan and usage window
Network errorProxy, VPN, DNSTest with a direct connection

Reset the login cleanly

  1. Run codex login status and note the account.
  2. Run codex logout if the account is wrong.
  3. Run codex login and finish in the browser.
  4. Restart the terminal so the new token is loaded.
  5. Check CODEX_API_KEY or a proxy env var that may override the login.
codex login status
codex logout
codex login

If login is fine but usage looks wrong

Authentication and usage are separate. A valid session can still be blocked by a window. Check the usage panel before changing credentials again.

If a tracker shows nothing after a successful login, the cause is file access, not auth. See Codex usage not showing.

Separate an auth failure from a usage block

MessageCauseFix
Not signed inExpired sessionRun the login command again
Token expiredRefresh failedSign out, then sign in
ForbiddenPlan or region restrictionCheck plan and account
Rate limitedUsage window or rateWait or switch account

Re-authenticating does not restore usage, and waiting does not fix an expired token. Read the exact error before trying either. If the CLI works but a tracker does not, the problem is file access rather than login, which Codex usage not showing covers.

Questions, answered

What does codex login status show?

It reports whether a session is active and which account it belongs to. Exact wording varies by version.

Why does Codex say I am not logged in after it worked yesterday?

The token expired or was revoked. Log in again; if it repeats, check for a proxy or clock skew.

Does logging out delete my usage history?

No. Session files stay on disk. Logging out only clears credentials.

Browse by topic