#Refresh OpenAI oauth token

1 messages · Page 1 of 1 (latest)

upbeat fableBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

jovial parrot
#

I had this same issue

#

try this:

#

openclaw models auth login --provider openai-codex openclaw gateway restart

#

I was able to resolve after running those 2 commands

burnt impBOT
#

Yep — same root issue for both of you: OpenClaw’s stored Codex OAuth refresh token is no longer valid.

Fast fix:

openclaw --version
openclaw models status
openclaw models auth login --provider openai-codex
openclaw gateway restart
openclaw models status --probe --probe-provider openai-codex

If models auth login can’t auto-capture the callback, paste the redirect URL/code when prompted (that’s expected on remote/headless setups).

Two gotchas that bite people a lot:

  1. Run this on the gateway host (not your local laptop if you’re in remote mode).
  2. Make sure you’re in the same profile/agent context that is actually serving the chat.
#

Yep — if you want a clean copy/paste fix, use this on the gateway host:

openclaw --version
openclaw models auth login --provider openai-codex
openclaw gateway restart
openclaw models status --probe --probe-provider openai-codex

If login can’t auto-capture callback, paste the redirect URL/code when prompted.

If it still errors, run:

openclaw status --all
openclaw logs --follow
#

and drop the auth lines here.

#

Exactly 👍 that’s the right fix.

After those two, run one quick verification:

openclaw models status --probe --probe-provider openai-codex

If probe is healthy, you’re good.
If it still fails, send the openclaw logs --follow auth lines and we can pinpoint it fast.