Your access token could not be refreshed because your refresh token was already used
Resolved 💬 45 comments Opened Jan 21, 2026 by quanstromberg-spec Closed Mar 29, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
v0.88.0
What subscription do you have?
pro
Which model were you using?
gpt-5.2-codex
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Terminal.app
What issue are you seeing?
<img width="602" height="388" alt="Image" src="https://github.com/user-attachments/assets/88c2cd2c-2b18-4936-9405-346146f0ce1b" /> Your access token could not be refreshed because your refresh token was
already used. Please log out and sign in again.
It doesnt work no matter what commend I send to it.
What steps can reproduce the bug?
Your access token could not be refreshed because your refresh token was
already used. Please log out and sign in again.
What is the expected behavior?
_No response_
Additional information
_No response_
45 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
If you're able to repro this, please use the
/feedbackcommand to upload your logs, then post the thread ID here. Without the additional logs, there's not much we can do to diagnose this particular problem.Is it possible that you had an another older copy of codex (either the CLI or IDE extension) running for a while in the background? We introduced a bug fix last week to address this issue, but if you had an older copy of codex still running, that would explain the problem you saw here.
Suggestion
THIS! 💯 Thank you!!! 💐
I ran into this:
ID 019c6707-9589-7642-baa6-b7c1608931ed
Reopening. @AndreasPK, are you using the Codex CLI, extension or app (or a combination of the above)?
I was using the vs code extension when it happened. I assume it was related to logging into it both on my notebook and desktop.
After the vscode extension stopped working I tried the console app which is from what I posted the log.
Logging out and in did eventually work though.
To make the timeline less confusing:
@AndreasPK, thanks for clarifying. I was hoping you'd say you were using the extension because I think we understand that problem. I have a pending PR that should fix it.
I just got the same error in Xcode 26.3
rm -f ~/.codex/auth.json
The error persists after 0.104.0 on Codex-CLI btw
ID: 019c8026-8f05-7a71-9aec-39851436a475
Just started getting this a couple minutes across the app and CLI. 019c8900-d9cc-7e43-b5e7-b4d95d29667c.
Update: Signing out and in again resolved it.
I'm cautiously optimistic that we've figured out the cause of this problem. This PR should take care of it. It will be included in the next release.
I'm seeing this error quite often. I think it might be caused by rapidly switching between multiple accounts by swapping saved
auth.jsonfiles.@Gusarich are you using the CLI, extension, or app?
I'm using CLI. I have multiple accounts and saved their
auth.jsonfiles after doing manualcodex login. Then I'm swapping that file to quickly change the account when needed, instead of re-logging again.@Gusarich, thanks for the details. Yes, that explains why you're seeing this. The auth mechanism in Codex is not designed to support usage of multiple concurrent instances of Codex on the same system with different logins. When you log in with a second account, the
auth.jsonfile is updated with that account's access and refresh token, and you are effectively logged out of your first account. Instances of Codex that were started with your first account will continue to run until their tokens expire, but they won't be able to refresh.I'd love to see some native support for switching accounts!
@Gusarich, there are two existing feature requests that you might be interested in upvoting: #12029 and #4432.
@llika23, if you're experiencing this, it's likely a different issue than the one that was fixed here. Feel free to open a new bug report and provide enough details for us to diagnose and investigate. That includes using
/feedbackto capture logs after this happens.Got it yesterday too
Can it be determined by the environment? Codex, for example, requires a tunnel to log in to the account, which is a more complicated approach than Claude uses, so the installation on the remote machine is not smooth.
@etraut-openai Thread id:
019cd903-68eb-7db1-beec-ecc0daa9a76c@davidmagbee, thanks for uploading your logs. By any chance, you sometimes switch between multiple ChatGPT accounts or between a ChatGPT account and API Key?
@etraut-openai Thanks for the response! I'll note I was able to fix the issue by deleting the
auth.jsonfile which prompted a new sign-in via ChatGPT. To answer your question, no, I do not switch between multiple accounts or between my account and an API key. I only ever log into services via my ChatGPT account tied OAuth'd via GitHub. I do use ChatGPT & Codex through via the desktop applications, the web apps, and VS Code extension (Codex). I hope this helps!Happening again, I predominately use the app. I have been using this session for a couple days with no issues until I got this message again. I do not use multiple accounts. 019ce737-feee-7f61-8a50-9f5d9da01e1d. Signing out and back in again fixes the issue but it is annoying.
I succeeded by deleting .codex folder from C:\Users\YOUR_USERNAME\.codex
I think that wipes the sessions, memory, etc. I managed to force a re-login by deleting just the auth.json file.
Same issue in Codex App: "Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again." Happens when compacting, but also in threads that are not compacting.
Done the above steps of as suggsted by citylab-a
Removing all involved threads from ~/.codex/sessions and ~/.codex/archived_sessions solves it.
3 times now of removing all the sessions and archived sessions
Any more tips
Ask GPT5.4 to solve the codex issue and it helped
````bash
1) close all Codex windows / terminals first
2) update Codex
npm install -g @openai/codex
3) log out
codex logout
4) remove cached auth as a clean reset
rm -f ~/.codex/auth.json
5) important: make sure an old API key is not overriding login
unset OPENAI_API_KEY
6) sign in again
codex login
or just run: codex
7) export new keys
export OPENAI_API_KEY='your-key'
````
Execute
rm -f ~/.codex/auth.jsonworks for me.We think this is fixed in the latest release (0.117.0). We've also added significantly more logging to help catch any remaining issues. If you are still experiencing this, please use
/feedbackto open a new bug report and include your thread ID so we can access your logs.Observed same issue in https://github.com/openai/codex/issues/17340 w/ v0.118.0
Issue #19531 Same issue is faced again recently tried all above method still same
ive been hitting this for months, and legit, deleted everything, the CLI works fine, but the vscode extension doenst.
I had the same problem but after I've executed
codex logoutin my terminal and I've switched to a pre-release version of github copilot in vscode extensions it worked.I've tried that to no avail.
On normal release, pre release, reinstalled, remove entire .codex folder etc.
:(
16272ca5-f171-4c9c-b7fb-9077234ce20b
1) remove auth.json (local, remote server and etc)
2) reauth
Execute
pkill -f "codex app-server" || trueworks for me.Hit the same error when trying to connect to ssh machine through codex desktop app. UI shows that the connection is live, but every time i send a message I get the same token error "_Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again._"
This issue has gone away for me.
I think it has something to do with copilot trying to login with the copilot subscription on the codex extension?
Are the people having this issue using codex and copilot on vscode?
I was able to fix it by removing the codex extension, deleting the codex folder, and logging into the codex CLI and then back into vscode extension setup.
Although the comments above appear to be hitting this in other areas like the codex app. 🤔
From a terminal run :