# Codex "Your access token could not be refreshed": Fix by the Reason

- URL: https://www.aifreehelp.com/en/posts/codex-access-token-could-not-be-refreshed
- Published: 2026-11-29
- Updated: 2026-11-29
- AI Free Help Editorial Team

> **Short answer:** "Your access token could not be refreshed" means Codex could not renew your ChatGPT sign-in, and the words after "because" tell you which fix to use: for "your refresh token was already used", quit every Codex window and background process, then sign in once. Logging out and back in almost never clears "your refresh token was revoked", so check status.openai.com for a Codex sign-in outage first, and nobody reports it clearing "you have since logged out or signed in to another account" on the same computer, so restart the Codex app, CLI session or remote connection that shows it. If you delete a file, quit Codex and delete only auth.json in your .codex folder, because the whole folder also holds your local Codex chats, settings and skills. Deleting auth.json does not sign Codex out when Codex keeps your login in the system keychain.

**Based on:** public user threads (2025–2026) · 8 official pages · counted November 29, 2026 · [How we word this](https://www.aifreehelp.com/en/editorial-policy#how-we-word-user-reports)

What each ending of this Codex sign-in message means, which one signing in again can fix, and which files are safe to delete.

**Matching interface messages:**

- “Your access token could not be refreshed because your refresh token was revoked. Please log out and sign in again.”
- “Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.”
- “Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again.”

"Your access token could not be refreshed because …" is a sign-in error in Codex: in the ChatGPT desktop app, the Codex CLI and the Codex editor extensions. It ends with "your refresh token was already used", "your refresh token was revoked" or "you have since logged out or signed in to another account". Your chats and projects are not deleted by this error.

OpenAI's documentation does not mention this message. This page is based on OpenAI's Codex documentation, the public [openai/codex source code](https://github.com/openai/codex) and replies from OpenAI's Codex maintainers. This site is not affiliated with OpenAI.

## Read the end of the message

The end of "Your access token could not be refreshed" tells you why Codex could not renew your ChatGPT sign-in. In the open-source Codex client, the endings with "your refresh token …" mean OpenAI's sign-in server refused the token. The "another account" ending is different: Codex decides it on your computer and does not ask the server at all ([Codex source: the five messages](https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/login/src/auth/manager.rs#L235-L240)).

| The message ends with | What it means | Do this first |
|---|---|---|
| "…because your refresh token was already used. Please log out and sign in again." | The server already exchanged this copy of the token. OpenAI's Codex maintainer points to an older copy of Codex still running in the background. | [Quit every Codex process, then sign in once](#already-used-quit-old-codex-processes-first) |
| "…because your refresh token was revoked. Please log out and sign in again." | The server ended this sign-in session. | [Check for an outage, then find where else this login is used](#was-revoked-check-for-an-outage-then-sign-in-fresh) |
| "…because you have since logged out or signed in to another account. Please sign in again." | The running Codex found that the saved login changed or is gone, so it stopped. | [Restart the Codex that shows it](#signed-in-to-another-account-restart-that-codex) |
| "Your access token could not be refreshed. Please log out and sign in again." (no reason) | The server refused the token without a reason Codex knows. | Treat it like "revoked". In a WSL project, see [SSH and WSL projects](#ssh-and-wsl-projects-fix-the-login-on-that-host). |
| "…because your refresh token has expired." | Codex has this message too. | Sign in again. |

Once one of these messages appears, the Codex process that shows it stops using that login. It does not try again until the saved login changes or the process restarts ([Codex pull request #15530](https://github.com/openai/codex/pull/15530)). If you sign in again with the same account, in the same `.codex` folder, a running Codex picks up the new login the next time a request fails. That does not mean "revoked" will clear. If you sign in with a different account, the running Codex does not pick it up.

"Failed to refresh token: 400 Bad Request: Your session has ended. Please log in again." is a different message, sent by OpenAI's sign-in server. Handle it like "revoked".

## "Already used": quit old Codex processes first

"Your access token could not be refreshed because your refresh token was already used" in Codex means another copy of Codex renewed the sign-in first, and this one still holds the old token. [OpenAI's Codex maintainer: the server accepts the same refresh token for about an hour](https://github.com/openai/codex/issues/10332#issuecomment-3831635259), so two windows renewing at the same moment do not cause it. [OpenAI's Codex maintainer: an older copy running in the background explains it](https://github.com/openai/codex/issues/9634#issuecomment-3781374630).

1. **Close every Codex window, then check that no Codex process is left.** Old copies include another editor window, a terminal left open for days, and a background Codex server. On macOS or Linux, run `pgrep -fl codex`. On Windows, open Task Manager and look for `codex.exe`. To end all of them on macOS or Linux, run `pkill -u "$USER" -x codex`. This stops any Codex task that is still running.
2. **Sign out and back in once, in one place.** This works for some people and not others. In the CLI, run `codex logout`, then `codex login`. In the desktop app and the editor extensions, use **Log out** in the profile menu ([Authentication](https://learn.chatgpt.com/docs/auth)). In VS Code, it is the last item under the gear icon ([OpenAI's Codex maintainer: log out from the gear menu](https://github.com/openai/codex/issues/14201#issuecomment-4031909393)).
3. **If it comes back, delete only auth.json, with Codex fully closed.** This often works, but not for everyone.
   - macOS and Linux: `rm ~/.codex/auth.json`
   - Windows (PowerShell): `Remove-Item "$env:USERPROFILE\.codex\auth.json"`

   Then open Codex and sign in. Deleting auth.json does not sign Codex out when Codex keeps your login in the system keychain. That is the case when `~/.codex/config.toml` sets `cli_auth_credentials_store` to `"keyring"`, or to `"auto"` on a computer where the system keychain is available ([Authentication: Credential storage](https://learn.chatgpt.com/docs/auth#credential-storage)), because Codex then reads the login from the keychain first ([Codex source: credential storage](https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/login/src/auth/storage.rs#L593-L616)). Run `codex logout` instead, which clears both places.
4. **Don't count on an update alone.** The fix that maintainers say targets this ending, [pull request #11802](https://github.com/openai/codex/pull/11802), shipped in [Codex CLI 0.105.0](https://github.com/openai/codex/releases/tag/rust-v0.105.0) in February 2026. More refresh fixes followed in [0.117.0](https://github.com/openai/codex/releases/tag/rust-v0.117.0). Neither makes "revoked" or "signed in to another account" go away. There is no evidence that updating clears "already used" by itself, so update, but still do steps 1 to 3.

If you use two ChatGPT accounts on one computer, expect this error. [OpenAI's Codex maintainer: Codex is not designed for concurrent instances with different logins](https://github.com/openai/codex/issues/9634#issuecomment-4016636369).

## "Was revoked": check for an outage, then sign in fresh

"Your access token could not be refreshed because your refresh token was revoked" in Codex means OpenAI's sign-in server has ended that session. Logging out and back in almost never clears it. In the Codex source, `codex logout`, **Log out** in the app, and `codex login` all revoke the current token before a new one is saved ([Codex source: login clears and revokes the old token](https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/cli/src/login.rs#L129-L145)). So when one saved login is copied to another machine, to WSL or to a remote host, signing in or out in one place revokes the copy in the others.

1. **Check [status.openai.com](https://status.openai.com) first.** It costs nothing. On September 25, 2026, "Codex users signing in with ChatGPT experienced elevated authentication errors" for over an hour ([OpenAI status: Issues with Codex](https://status.openai.com/incidents/01M3DCNWMW57HYK8FJ5FBFPA39)). During an incident like that, signing in again may fail until it is resolved.
2. **Think about where else this login lives.** OpenAI's [Authentication](https://learn.chatgpt.com/docs/auth#login-on-headless-devices) page tells you to copy `~/.codex/auth.json` to a headless machine. Its [CI/CD guide](https://learn.chatgpt.com/docs/auth/ci-cd-auth) says "Do not share the same file across concurrent jobs or multiple machines." If you copied the file, sign in separately on each machine instead. On a machine without a browser, use `codex login --device-auth`. Device code sign-in must first be turned on in your ChatGPT security settings, or by an admin in the workspace permissions for a workspace account ([Authentication](https://learn.chatgpt.com/docs/auth#login-on-headless-devices)).
3. **If you changed your account security, sign in again in every Codex.** When you turn on Advanced Account Security, OpenAI says "you are signed out of all devices", and later sessions are shorter ([Advanced Account Security](https://help.openai.com/en/articles/20001221-advanced-account-security)). Adding a password, a passkey or a security key can end Codex sessions too.
4. **Quit Codex completely, delete auth.json, and sign in in one Codex only.** With "revoked", three things have each helped only in rare cases: deleting only auth.json, signing in from the CLI instead of the app, and signing out the Codex sessions on chatgpt.com. The sessions are in **Settings** > **Security**, under active sessions (as of November 2026); sign them out, then sign in in one Codex only.
5. **If it still fails, contact OpenAI Support** through [help.openai.com](https://help.openai.com). Include your Codex version and the time of the error ([OpenAI Support staff: update the app, then add these details](https://community.openai.com/t/1392211/4)).

## "Signed in to another account": restart that Codex

"Your access token could not be refreshed because you have since logged out or signed in to another account" means the Codex that shows it was started with one login, and the saved login on disk is now different or missing. Codex shows this message without asking the server ([Codex source: the account check](https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/login/src/auth/manager.rs#L2992-L3015)). Nobody reports signing in again in the desktop app, or on the same computer, clearing it. Restarting the Codex process or connection that shows it often does.

It appears after you log out in another window, sign in with a different account or workspace, or delete auth.json while Codex is still open. [OpenAI's Codex maintainer: auth.json is not the live login of a running Codex](https://github.com/openai/codex/issues/43010#issuecomment-5552907620).

1. **Find which Codex shows it**: the desktop app, a CLI session, an editor window, or a remote project.
2. **Restart that one.**
   - Desktop app: quit it, and check that it is not still running in the background, then open it again.
   - CLI: exit every Codex session. On macOS or Linux, `pkill -u "$USER" -x codex` ends them all, including running tasks. If you use the background server, run `codex app-server daemon restart` (Codex CLI 0.131.0 or later) or type `/daemon` and choose **Restart background server** ([Slash commands in Codex CLI](https://learn.chatgpt.com/docs/developer-commands?surface=cli)).
   - Editor: reload or restart the editor window.
   - Remote project in the desktop app: restart the connection in **Settings** > **Connections** (as of November 2026), or follow [SSH and WSL projects](#ssh-and-wsl-projects-fix-the-login-on-that-host).
3. **Use one account at a time on that computer.** Sign in with the account you want, then reopen your chats.

## SSH and WSL projects: fix the login on that host

A Codex SSH or WSL project uses the login saved on that host, not the one in your desktop app. OpenAI's [Remote connections](https://learn.chatgpt.com/docs/remote-connections) page says to "Install and authenticate Codex on the remote host", and that remote access uses "the connected host's … credentials". The [Windows app](https://learn.chatgpt.com/docs/windows/windows-app) page says Codex inside WSL "doesn't automatically share configuration, cached auth, or session history with the Windows app." So signing in again in the desktop app does not fix a remote project. Fixing the login on that host often does.

1. **Check the login on that host.** Over SSH, or in a WSL terminal, run `codex login status`. Use the same user that the connection uses.
2. **Sign in there.** Run `codex logout`, then `codex login --device-auth`. Device code sign-in must first be turned on in your ChatGPT security settings, or by an admin in the workspace permissions for a workspace account ([Authentication](https://learn.chatgpt.com/docs/auth#login-on-headless-devices)). For WSL from Windows, you can also close the app, move the WSL file aside with `wsl -- sh -c 'mv ~/.codex/auth.json ~/.codex/auth.json.bak'`, reopen the app, and sign in to the WSL connection in settings.
3. **Restart the remote side.** Restart the connection in **Settings** > **Connections**, or end the Codex processes on that host with `pkill -u "$USER" -x codex`, then reopen the project. The [`/daemon` documentation](https://learn.chatgpt.com/docs/developer-commands?surface=cli) says: "For a remote connection, manage the server on its host."

The command `codex app-server daemon restart`, which search answers suggest for SSH projects, restarts the background server of the Codex CLI on the machine where you run it. It is not a desktop app setting for SSH projects. Run it on the remote host only if you use the Codex CLI there.

## Common fixes that don't help, or cost you something

Search answers for "Your access token could not be refreshed" in Codex repeat fixes that don't hold up for every ending.

| Common advice | What actually happens |
|---|---|
| Log out and sign in again, several times | Works for some people with "already used". Almost never helps with "revoked". For "signed in to another account" on the same computer, restart the Codex that shows it instead. |
| Keep only one window open while you sign in | The server accepts the same refresh token for about an hour. What matters is closing old Codex windows and processes. |
| Delete the whole `.codex` folder | It also deletes your Codex chats (`sessions` and `archived_sessions`), `config.toml` and skills ([Troubleshooting](https://learn.chatgpt.com/docs/reference/troubleshooting), [Environment variables](https://learn.chatgpt.com/docs/config-file/environment-variables)). On Windows, the desktop app and the CLI share `%USERPROFILE%\.codex`. Delete only `auth.json`. |
| Delete auth.json while Codex is open | The running Codex keeps its own copy of the login. Its next check finds no saved login and shows "signed in to another account". Quit Codex first. |
| "Update to 0.117.0, PR #11802 fixed it" | Pull request #11802 shipped in 0.105.0. Version 0.117.0 has other refresh fixes. Neither makes "revoked" or "signed in to another account" go away. |
| Reinstall the desktop app | There is no evidence that reinstalling clears any of these endings. |

## Questions

### How do I sign out of Codex?

See [step 2 of the "already used" fixes](#already-used-quit-old-codex-processes-first) for each app. In the CLI, `codex login status` shows which login is active. On a Mac without the CLI installed, you can run the CLI bundled with the desktop app, at `/Applications/Codex.app/Contents/Resources/codex` ([Troubleshooting](https://learn.chatgpt.com/docs/reference/troubleshooting)), with `logout`.

### How long does a Codex sign-in last?

OpenAI says Codex renews the sign-in "automatically during use before they expire" ([Authentication](https://learn.chatgpt.com/docs/auth)). Its CI/CD guide says Codex renews saved tokens that are older than about 8 days ([Maintain Codex account auth in CI/CD](https://learn.chatgpt.com/docs/auth/ci-cd-auth)). With Advanced Account Security turned on, sessions are shorter. A session also ends when you log out of that login anywhere.

## Sources

- [Authentication](https://learn.chatgpt.com/docs/auth) — Checked 2026-11-29
- [Maintain Codex account auth in CI/CD (advanced)](https://learn.chatgpt.com/docs/auth/ci-cd-auth) — Checked 2026-11-29
- [Remote connections](https://learn.chatgpt.com/docs/remote-connections) — Checked 2026-11-29
- [ChatGPT desktop app for Windows](https://learn.chatgpt.com/docs/windows/windows-app) — Checked 2026-11-29
- [Environment variables](https://learn.chatgpt.com/docs/config-file/environment-variables) — Checked 2026-11-29
- [Troubleshooting](https://learn.chatgpt.com/docs/reference/troubleshooting) — Checked 2026-11-29
- [Issues with Codex](https://status.openai.com/incidents/01M3DCNWMW57HYK8FJ5FBFPA39) — Checked 2026-11-29
- [Advanced Account Security](https://help.openai.com/en/articles/20001221-advanced-account-security) — Checked 2026-11-29
