🦞OpenClaw Guide
Authentication

Claude OAuth Not Working — 401 Error

Claude OAuth token expired or invalid. How to re-authenticate.

⚠️ The Problem

Claude OAuth was working, but now fails with: `` 401 invalid bearer token Provider anthropic is treating OAuth as API key `` Other providers (OpenAI, etc.) still work fine.

🔍 Why This Happens

OAuth tokens can expire or be revoked. This happens when: 1. Token expired — OAuth tokens have limited lifespans 2. Session revoked — You logged out of Claude or changed password 3. Account issue — Billing problem or subscription change 4. Auth store corrupted — Local token storage got damaged

The Fix

Re-authenticate with Claude using OAuth:

bash
openclaw auth add anthropic

When prompted, choose the OAuth flow (opens browser).

If that doesn't work, try removing the old auth first:

bash
openclaw auth remove anthropicopenclaw auth add anthropic

Verify the auth is working:

bash
openclaw models status --probe

Check what auth type is stored:

bash
openclaw config get auth

If it shows api_key but you want OAuth, the auth flow might not be detecting OAuth correctly. Try the OAuth flow explicitly.

🔥 Your AI should run your business, not just answer questions.

We'll show you how.$97/mo (going to $197 soon)

Join Vibe Combinator →

📋 Quick Commands

CommandDescription
openclaw auth add anthropicRe-authenticate with Claude
openclaw auth remove anthropicRemove old auth
openclaw models status --probeTest if auth works

Related Issues

🐙 Your AI should run your business.

Weekly live builds + template vault. We'll show you how to make AI actually work.$97/mo (going to $197 soon)

Join Vibe Combinator →

Still stuck?

Join our Discord community for real-time help.

Join Discord