#401 token expired or incorrect

1 messages · Page 1 of 1 (latest)

maiden summitBOT
#

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

simple flumeBOT
#

That error text is almost always an auth problem (something is sending a request with a bad/expired token) — not “the model is down”.

Two common places it shows up in OpenClaw:

1) You see it in the Control UI / dashboard

That means the Gateway UI token doesn’t match gateway.auth.token anymore (old bookmark, token rotated, wrong host/port).

Fix:

  • Run openclaw dashboard and open the fresh URL it prints (it includes the right #token=...)
  • Or open the Control UI → settings → paste the correct token again

Docs: https://docs.openclaw.ai/help/faq (section “The Control UI says unauthorized…”)

2) You see it as a reply when the bot tries to answer in chat

Then your new “free model fallback” is likely routing to a provider that needs OAuth/API key, and that credential is missing or expired (so the provider returns 401).

Fastest way to pinpoint which provider/model is failing:

#
  • In chat, run: /model status (then paste the output here; redact secrets)
  • On the gateway host, run: openclaw models status

If it’s an OAuth-based provider (ex: Codex OAuth / Google Antigravity / etc), the fix is usually just re-login:

  • openclaw models auth login --provider <provider> --set-default

Docs:

Quick questions so I can give the exact fix

  1. Where exactly do you see the message (dashboard page vs bot reply in Discord)?
  2. Paste openclaw --version
  3. Paste /model status or openclaw models status (redact tokens/keys)
#

That /model status shows you’re still actually running zai/glm-5 as primary, so the “401 token expired or incorrect” is very likely coming from the Z.AI endpoint/key.

If you want to switch to OpenRouter’s free GLM-Air:

Quick fix (right now, in Telegram)

Send one of these:

  • /model GLM-Air-Free
    (since your picker shows that alias/name)
  • or the explicit id: /model openrouter/z-ai/glm-4.5-air:free

Then try a normal message again.

Make it the default (recommended)

Run this on the gateway host:

#
openclaw models set openrouter/z-ai/glm-4.5-air:free

Then in Telegram start a fresh session (model choices can be “sticky” per session):

  • /new

Optional: stop it from falling back to Z.AI at all

If you previously added fallbacks that include zai/..., clear them:

openclaw models fallbacks clear

(or re-add only OpenRouter fallbacks you want)