Skip to main content
Watch: Anthropic Just Hit the Brakes on Its Next AI Model

OpenAI Codex CLI error

Codex CLI: Your access token could not be refreshed because your refresh token was...

Error message
Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.

Status: Fixed in releaseLast verified 2 documented fixes4 sources

What it means

Codex tried to refresh your ChatGPT sign-in, but the refresh token had already been consumed, so the session cannot authenticate until you sign in again. Current source also has a separate message for an account change: "Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again."

Causes

  • A contributor on #9634: an older copy of Codex (CLI or IDE extension) left running in the background can cause this.
  • A hole in token refresh logic for the app server used by the IDE extension, fixed in PR #11802.

How to fix it

  1. Fix 1.

    Update Codex. A contributor said they think this is fixed in 0.117.0 and that significantly more logging was added; PR #11802 (Fixed a hole in token refresh logic for app server) first shipped in 0.105.0.

  2. Fix 2.

    Log out and sign in again, as the message says, and close older Codex CLI or extension processes that may still be running.

    Terminal
    codex logout
    codex login

More Codex CLI errors

All 14 Codex CLI errors

FAQ

What does "Your access token could not be refreshed because your refresh token was..." mean in Codex CLI?

Codex tried to refresh your ChatGPT sign-in, but the refresh token had already been consumed, so the session cannot authenticate until you sign in again. Current source also has a separate message for an account change: "Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again."

How do I fix "Your access token could not be refreshed because your refresh token was..."?

There are 2 documented fixes. Start with the first: Update Codex. A contributor said they think this is fixed in 0.117.0 and that significantly more logging was added; PR #11802 (Fixed a hole in token refresh logic for app server) first shipped in 0.105.0.

Is this Codex CLI error fixed?

Status: Fixed in release. A release fixed this. The affected versions note says where the fix landed. Affected versions: Reported on v0.88.0 (#9634); a contributor said it is fixed in 0.117.0, though later comments on #9634 still report it

Sources

Last verified against 4 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.