Skip to main content
RocketKey

Claude Code error 401 Unauthorized / Key is blocked / Expired Key

Error 401 with RocketKey: wrong key, blocked key, expired plan or a leftover ANTHROPIC_API_KEY. Causes and the fix for each case.

Updated 20 Oct 2026

Error 401 means RocketKey did not accept the key in the request. Typical messages: 401 Unauthorized, Invalid API key, Key is blocked, Expired Key.

Invalid API key / Authentication error

Cause
The key has a typo, is truncated, or was deleted in the Dashboard.
Fix
Copy the key again (or create a new one in Dashboard → API keys) and update your tool's configuration.

Claude Code still uses an old key

Cause
An old ANTHROPIC_API_KEY variable or an Anthropic account sign-in takes precedence over ANTHROPIC_AUTH_TOKEN.
Fix
Type /logout in Claude Code, remove ANTHROPIC_API_KEY from your environment and shell profile, then open a new terminal.

Key is blocked

Cause
The plan expired, the account is suspended, or the order was refunded: every key of the account is blocked.
Fix
Check your plan status in the Dashboard. Renew the plan to unblock the keys; if the account is suspended, contact support.

Expired Key

Cause
The plan period has ended.
Fix
Renew in Dashboard → Billing. Your existing key works again as soon as the new period starts.

Quick check

Run the curl command from Getting started with your key. If curl works but your tool still says 401, the problem is the tool's configuration (environment variable not loaded, wrong config file).

Need help?

Pick a contact channel below.

Support hours: 8:00 – 22:00 (GMT+7), every day

We never ask for your password or API key.