OpenAI login fails with a private-address OAuth error

Adapted community discussion: Paraphrased and condensed from an anonymized public OpenClaw Discord support conversation from August 2026. Technical guidance was reviewed for OpenClaw 2026.9.3.

I logged back into my OpenAI account, but the agent still fails before it can reply. The error looks like an expired model at first, then says the OpenAI Codex token refresh was blocked because the address resolved to a private or special-use IP.

Is my model access expired, or is this a different problem?

The generic failure can come from either a stale model selection or authentication, so let us check both before changing anything. Please run:

openclaw --version
openclaw models status
openclaw models list --provider openai
openclaw config get agents.defaults.model --json

If the current conversation is pinned to an old model, /model default resets that session to the configured default. You can also retry the provider login with:

openclaw models auth login --provider openai

Keep OAuth tokens and any dashboard URL private.

The login itself fails before it completes. The shorter error is: OpenAI Codex token exchange error: Blocked: resolves to private/internal/special-use IP address.

That confirms this is not a model-expiry message. The OAuth hostname is resolving to an address that OpenClaw’s request guard will not contact. Common causes include a VPN, filtering DNS, a hosts-file override, a corporate proxy, container DNS, or an IPv6 routing problem.

Check name resolution on the same host or container that runs the Gateway. On Linux, for example:

getent ahosts auth.openai.com

The provider hostname should resolve to public addresses. Fix the DNS, VPN, proxy, or hosts entry if it resolves to a private or reserved range. Keep the request guard enabled. Then retry:

openclaw models auth login --provider openai
openclaw models status

For a headless host, the current login command also supports --device-code. If name resolution is public and the error continues, share only your OpenClaw version and sanitized resolver output.