#Refresh OpenAI oauth token
1 messages · Page 1 of 1 (latest)
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
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:
- Run this on the gateway host (not your local laptop if you’re in remote mode).
- Make sure you’re in the same profile/agent context that is actually serving the chat.
If it still fails after re-login, grab:
openclaw status --all
openclaw logs --follow
and paste the auth error lines here.
Docs:
- https://docs.openclaw.ai/concepts/oauth
- https://docs.openclaw.ai/providers/openai
- https://docs.openclaw.ai/help/faq#how-does-codex-auth-work
Glad that helped? Please mark the solution (right-click message → Apps → ✅ Mark Solution) so Answer Overflow indexes it.
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.