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_

View original on GitHub ↗

45 Comments

github-actions[bot] contributor · 6 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #7403

Powered by Codex Action

etraut-openai contributor · 6 months ago

If you're able to repro this, please use the /feedback command 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.

quanstromberg-spec · 5 months ago

Suggestion

  1. Send the screen shot to Claude and describe the problem, and ask what to do.
  2. Open a complete new terminal and type in the commends that claude suggested.
Kenerator · 5 months ago
Suggestion 1. Send the screen shot to Claude and describe the problem, and ask what to do. 2. Open a complete new terminal and type in the commends that claude suggested.

THIS! 💯 Thank you!!! 💐

AndreasPK · 5 months ago
If you're able to repro this, please use the /feedback command 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.

I ran into this:

ID 019c6707-9589-7642-baa6-b7c1608931ed

etraut-openai contributor · 5 months ago

Reopening. @AndreasPK, are you using the Codex CLI, extension or app (or a combination of the above)?

AndreasPK · 5 months ago

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.

AndreasPK · 5 months ago

To make the timeline less confusing:

  • I used the vscode extension on the weekend on the notebook.
  • Used the vscode extension today for some time on my desktop. Got the above error at some time while working.
  • Prompted by this I launched the app on my desktop which failed in the same manner. I posted the /feedback for this.
  • I then successfully logged out and back in in vscode. Which refreshed the token I assume and things worked again after in the vscode extension.
etraut-openai contributor · 5 months ago

@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.

theedov · 5 months ago

I just got the same error in Xcode 26.3

TheOneAbove0 · 5 months ago

rm -f ~/.codex/auth.json

otaliptus · 4 months ago

The error persists after 0.104.0 on Codex-CLI btw

ID: 019c8026-8f05-7a71-9aec-39851436a475

garrytaulu · 4 months ago

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.

etraut-openai contributor · 4 months ago

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.

Gusarich · 4 months ago

I'm seeing this error quite often. I think it might be caused by rapidly switching between multiple accounts by swapping saved auth.json files.

etraut-openai contributor · 4 months ago

@Gusarich are you using the CLI, extension, or app?

Gusarich · 4 months ago
@Gusarich are you using the CLI, extension, or app?

I'm using CLI. I have multiple accounts and saved their auth.json files after doing manual codex login. Then I'm swapping that file to quickly change the account when needed, instead of re-logging again.

etraut-openai contributor · 4 months ago

@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.json file 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.

Gusarich · 4 months ago
@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.json file 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!

etraut-openai contributor · 4 months ago

@Gusarich, there are two existing feature requests that you might be interested in upvoting: #12029 and #4432.

etraut-openai contributor · 4 months ago

@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 /feedback to capture logs after this happens.

loglux · 4 months ago

Got it yesterday too

loglux · 4 months ago

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.

davidmagbee · 4 months ago

@etraut-openai Thread id: 019cd903-68eb-7db1-beec-ecc0daa9a76c

etraut-openai contributor · 4 months ago

@davidmagbee, thanks for uploading your logs. By any chance, you sometimes switch between multiple ChatGPT accounts or between a ChatGPT account and API Key?

davidmagbee · 4 months ago
@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.json file 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!

garrytaulu · 4 months ago
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.

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.

CrazyTolstoy · 4 months ago

I succeeded by deleting .codex folder from C:\Users\YOUR_USERNAME\.codex

mrjanosf · 4 months ago
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.

citylab-ai · 4 months ago

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.

  • Sign out and sign in does not solve it.
  • Removing all involved threads from ~/.codex/sessions and ~/.codex/archived_sessions solves it.
buildersnk · 4 months ago

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

buildersnk · 4 months ago

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'

````

lrphael · 3 months ago

Execute rm -f ~/.codex/auth.json works for me.

etraut-openai contributor · 3 months ago

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 /feedback to open a new bug report and include your thread ID so we can access your logs.

nightsparc · 3 months ago

Observed same issue in https://github.com/openai/codex/issues/17340 w/ v0.118.0

Kushalkhemka · 2 months ago

Issue #19531 Same issue is faced again recently tried all above method still same

Nick2bad4u · 2 months ago

ive been hitting this for months, and legit, deleted everything, the CLI works fine, but the vscode extension doenst.

TaridaGeorge · 2 months ago

I had the same problem but after I've executed codex logout in my terminal and I've switched to a pre-release version of github copilot in vscode extensions it worked.

Nick2bad4u · 2 months ago
I had the same problem but after I've executed codex logout in 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.

:(

TimChesko · 2 months ago

16272ca5-f171-4c9c-b7fb-9077234ce20b

TimChesko · 2 months ago

1) remove auth.json (local, remote server and etc)
2) reauth

MAG10d · 2 months ago

Execute pkill -f "codex app-server" || true works for me.

Focus2321 · 2 months ago

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._"

Nick2bad4u · 2 months ago

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. 🤔

sparkup · 1 month ago

From a terminal run :

> codex
> /logout
> codex
> /login