Claude Code · Sign-in
API Error: 400 This organization has been disabled
“This organization has been disabled” in Claude Code usually means an old ANTHROPIC_API_KEY is overriding your subscription. How to check and fix it.
Message
The exact error
Your ANTHROPIC_API_KEY belongs to a disabled organization · Unset the environment variable to use your subscription insteadAlso appears as:
- When the key is your only credential
- Your ANTHROPIC_API_KEY belongs to a disabled organization · Update or unset the environment variable
- Raw API wording (older versions)
- API Error: 400 ... This organization has been disabled.
Meaning
What does “This organization has been disabled” mean?
The API key Claude Code is sending belongs to an Anthropic Console organisation that has been disabled. Most often that’s not your current account: it’s a stale ANTHROPIC_API_KEY from a previous job, project or trial, still exported in your shell profile or loaded from a .env file. Environment variables take priority over /login, so the dead key is used even when you have a working Pro or Max plan, and in -p mode the key is always used when present. Current versions say so directly; older ones showed only the raw 400 from the API.
Causes
Why do I see it with an active subscription?
- An old
ANTHROPIC_API_KEYin~/.zshrc,~/.bashrc,~/.profile, your PowerShell profile or Windows user environment variables - A
.envfile in the project that setsANTHROPIC_API_KEY - A key from a Console organisation that was closed, suspended or removed
- Less often, your own account or organisation really was disabled
Fix
How do I fix “This organization has been disabled”?
Unset the key and relaunch
Remove the variable from the current shell, then start
claudeagain. If you have a saved subscription login, it takes over.macOS / Linux unset ANTHROPIC_API_KEY claudeWindows PowerShell Remove-Item Env:ANTHROPIC_API_KEY claudeRemove it permanently
Delete the
export ANTHROPIC_API_KEY=...line from~/.zshrc,~/.bashrcor~/.profile. On Windows, check your PowerShell profile ($PROFILE) and your user environment variables. Look for project.envfiles too.Find it (macOS / Linux) grep -n ANTHROPIC_API_KEY ~/.zshrc ~/.bashrc ~/.profile 2>/dev/nullFind it (Windows PowerShell) [Environment]::GetEnvironmentVariable("ANTHROPIC_API_KEY", "User") Select-String -Path $PROFILE -Pattern ANTHROPIC_API_KEYIf the message says “Update or unset”
You have no saved login to fall back to. Unset the key and run
/login, or replace it with a key from an active Console organisation. Our Anthropic API key guide shows where to create one.Confirm the active credential
Run
/statusinside Claude Code. It should now show your subscription, or the new key.If no key is set and it persists
Then the account or organisation itself may be disabled. Contact Anthropic support, or sign in with a different account.
Explained
Does “This organization has been disabled” mean I was banned?
Not usually. Anthropic’s documentation treats it first as a credential problem: an old key from a disabled Console organisation overriding a working subscription. Check for that before anything else, because it takes a minute and is the common case. Only if /status shows your subscription, no ANTHROPIC_API_KEY is set anywhere and the error continues is it worth contacting support about the account itself.
To avoid the clash in future, keep API keys out of your global shell profile and set them only in the shell or job that needs them, or have Claude Code fetch one with an apiKeyHelper script (the settings builder can add one). Never commit a key to a project file. A stray key can also cause Credit balance is too low.
FAQ
Questions people ask
Why does Claude Code use my API key instead of my subscription?
Environment variables take precedence over /login. When ANTHROPIC_API_KEY is set and approved, Claude Code sends it instead of your subscription login, and in -p mode it always uses the key when present. Unset the variable and remove it from your shell profile to use the subscription.
I unset the key but still see the error. What now?
Open a new terminal, since the old one may still have it, and check for a .env file in the project and for user-level environment variables on Windows. Run /status to see what Claude Code is using. If no key is set anywhere, the account itself may be disabled: contact Anthropic support.
Is this error a 400 or a 401?
The API returns it as a 400 with the text “This organization has been disabled”, which is why older versions showed “API Error: 400”. Current versions recognise it and print a clearer message naming ANTHROPIC_API_KEY. A 401 is a different error, about credentials that were revoked or are invalid.
Related
Related errors
Keep exploring