“This Organization Has Been Disabled” in Claude Code: What It Means

“This Organization Has Been Disabled” in Claude Code: What It Means

If Claude Code stops with “API Error: 400 … This organization has been disabled”, it almost always means Claude Code is sending an old Anthropic API key, not your current subscription login. When people search for claude this organization has been disabled, the usual story is an ANTHROPIC_API_KEY left in a shell profile or .env file from a previous job or project, and the Console organization behind that key is no longer active.

Your Pro, Max, Ultra, Team or Enterprise plan is usually fine. Claude Code simply picks the API key ahead of your /login credentials, so the request goes to the wrong organization. Here is the short fix list:

  • Run env | grep ANTHROPIC in the terminal where you start Claude Code to see whether a key is set.
  • Run unset ANTHROPIC_API_KEY, then start claude again.
  • Delete the export ANTHROPIC_API_KEY=... line from ~/.zshrc, ~/.bashrc, ~/.profile or your project’s .env file so it doesn’t come back.
  • Run /status inside Claude Code to confirm it now uses your Claude account.
  • If no key is set and the error stays, sign in again with /login and contact Anthropic support or your organization admin.

This guide is part of our help series. Browse all our Claude Code tutorials for more fixes and how-tos.

Tested with Claude Code v2.1.325 on macOS on November 17, 2026. We can’t safely trigger a disabled organization, so the exact error text comes from Anthropic’s official documentation. We did reproduce the cause for real in a demo folder with a made-up key, and every terminal capture below is real.

We tested on macOS; the Windows steps follow Anthropic’s official instructions.

This Organization Has Been Disabled: Quick Summary

QuestionShort answer
Exact messageAPI Error: 400 ... This organization has been disabled.
Newer wordingYour ANTHROPIC_API_KEY belongs to a disabled organization
Most common causeA stale ANTHROPIC_API_KEY from a disabled Console organization
Is my subscription cancelled?Usually no; the key overrides your saved login
Fastest fixunset ANTHROPIC_API_KEY, then relaunch claude
Permanent fixRemove the key from your shell profile or .env file
How to check/status shows which credential is active
Still failing with no key?Contact Anthropic support or your organization admin
Diagram showing why Claude Code says this organization has been disabled: an old API key in your shell is used ahead of your /login subscription, the key's organization is disabled, and the API returns error 400
How an old API key turns a working subscription into an “organization disabled” error.

What “This Organization Has Been Disabled” Means

Anthropic’s error reference describes this message plainly. Claude Code is using a stale ANTHROPIC_API_KEY from a disabled Console organization, and when you also have a saved subscription login, the key overrides it.

Newer versions of Claude Code show one of two hints after the dot. “Unset the environment variable to use your subscription instead” appears when a stored /login can take over once the key is gone. “Update or unset the environment variable” appears when the key is your only credential.

Claude Code docs error reference entry for This organization has been disabled, highlighting the three message forms including API Error 400
The official error reference lists all three forms of the message.

The “organization” here is a Claude Console account, the one used for pay-as-you-go API keys. It is separate from your claude.ai subscription. An organization can be disabled because a company closed its account, removed your access, or stopped paying, and any key it issued stops working at that point.

Why your paid plan doesn’t help

Claude Code picks one credential when several are present. The authentication precedence list puts the ANTHROPIC_API_KEY environment variable above your subscription login from /login, which sits last.

Claude Code authentication docs showing the precedence list where the ANTHROPIC_API_KEY environment variable ranks above subscription OAuth credentials
The API key variable ranks above your subscription login in Claude Code’s precedence order.

In an interactive session, Claude Code asks you once whether to use a key it finds, and it remembers your answer. In non-interactive mode with claude -p, the docs say the key is always used when present, with no question asked. That is why scripts and CI jobs often hit this error even when the interactive app works.

Why Claude Code Uses the Old Key: We Reproduced It

To show the cause without touching a real account, we exported a made-up key in a demo folder and asked Claude Code for a one-word reply. A fake key gives “Invalid API key” rather than the disabled-organization text, but the mechanism is identical: the key wins over a working login.

Terminal showing claude -p failing with Invalid API key after an ANTHROPIC_API_KEY is exported, with a warning that the key takes precedence over the claude.ai login
With a key exported, Claude Code skips the working login and the request fails.

Notice the yellow warning. Claude Code says the API key “takes precedence over your claude.ai login”, which is exactly the situation behind the organization disabled error. With a real key from a disabled organization, the last line would be the 400 error instead.

We also started an interactive session with the same key set. Claude Code showed the “Detected a custom API key in your environment” prompt and recommended No.

Claude Code prompt Detected a custom API key in your environment with the options Yes and No, recommended
The one-time prompt you see when Claude Code finds a key. Choosing Yes is what makes an old key stick.

If you ever answered Yes to this prompt months ago, that old choice can be the whole reason your subscription seems broken today.

Fix 1: Unset the Old API Key

This is the fix Anthropic’s troubleshooting guide gives first. Remove the variable from the current shell and start Claude Code again.

unset ANTHROPIC_API_KEY
claude

On Windows PowerShell, the official command is:

Remove-Item Env:ANTHROPIC_API_KEY
claude

Here is the same demo folder after unset. env | grep ANTHROPIC finds nothing, and the same one-word prompt now answers through the subscription login.

Terminal showing unset ANTHROPIC_API_KEY, an empty env grep, and claude -p replying ok with exit code 0
After unsetting the key, Claude Code falls back to the saved login and replies “ok”.

unset only affects the terminal window you type it in. Open a new terminal and the key comes back if your shell profile sets it, which leads to Fix 2.

Fix 2: Remove the Key From Your Shell Profile or .env File

The docs point to ~/.zshrc, ~/.bashrc and ~/.profile as the usual places for a forgotten export ANTHROPIC_API_KEY=... line. On Windows, check your PowerShell profile at $PROFILE and your User environment variables.

Don’t forget project files. The error reference warns that tools like direnv, dotenv shell plugins and IDE terminals can load a stale key from a .env file without you setting it yourself. We used a made-up profile and .env in the demo folder to show the search and cleanup.

Terminal using grep to find ANTHROPIC_API_KEY lines in a demo zshrc and .env file, deleting them with sed, and confirming none remain
Finding the key lines, deleting them, then confirming the search comes back empty.

On your own machine, the search looks like this:

grep -n ANTHROPIC_API_KEY ~/.zshrc ~/.bashrc ~/.profile .env 2>/dev/null

Open the file that matches in a text editor and delete the line, or comment it out with #. Then close the terminal, open a new one, and start claude.

Check settings.json and apiKeyHelper too

A key can also come from the env block in a settings file or from an apiKeyHelper script. Our settings guide shows where those files live. If /status mentions apiKeyHelper, remove that setting from your settings.json.

Claude Code docs What to do list for the organization disabled error: unset ANTHROPIC_API_KEY, replace the key, run /status, contact support
Anthropic’s own “What to do” list for this error.

Fix 3: Confirm the Active Login With /status

Run /status inside Claude Code after the cleanup. The Login method row should show your Claude account, and the docs say /status marks the credential that isn’t in use when both a login and an API key are configured.

Claude Code /status panel showing Login method Claude account, Organization and Email rows, masked for privacy
/status after the fix: the login method is the Claude account, not an API key. Personal details are masked.

If you chose Yes at the API key prompt in the past, open /config while the key is still set. The docs describe a “Use custom API key” toggle there, which only appears while ANTHROPIC_API_KEY is in your environment.

Fix 4: Replace the Key or Contact Support

Sometimes you really do need API key access, for example in a CI pipeline. In that case, the docs say to replace the key with one from an active Console organization. If the organization belongs to your company, ask its admin whether it was closed or whether your access was removed.

For automation without a key, our guide to headless authentication covers claude setup-token, which creates a long-lived token from your subscription.

Decision diagram for the Claude Code organization disabled error: if env shows a key, unset it and delete the line; if /status shows an API key or helper, remove it; if you need API key access, get a new key from an active org; otherwise run /login and contact support
Which fix to use, from the most likely cause down.

If no environment variable is set and the error persists, the official advice is to contact support or sign in with a different account. The troubleshooting page says to sign in at claude.ai, click your initials in the lower left, and choose Get help.

Related Errors That Look Similar

Several messages mention your organization but mean different things. Our common errors guide covers many of them, and this table sums up the closest ones from the error reference.

MessageWhat it meansWhat to do
This organization has been disabledStale key from a disabled Console orgUnset the key, use /login
Your organization has disabled API key authenticationYour Console admin turned off API keysRemove the key or apiKeyHelper, then /login
Your organization has disabled Claude subscription accessYour Claude org blocks subscription sign-in for Claude CodeAsk your admin, or use a Console API key
API Error: 401 Invalid authentication credentialsCredential revoked, or account or org no longer activeCheck /status, then /login
Invalid API key · Fix external API keyThe key itself is wrong or revokedUnset or replace the key

If you see a 401 or 403 instead, our authentication error fix walks through those codes. For sign-in trouble in general, see login problems.

Try It Yourself

You can check your own setup in under a minute without changing anything. Paste this into the terminal you normally use to start Claude Code:

env | grep ANTHROPIC
grep -n ANTHROPIC_API_KEY ~/.zshrc ~/.bashrc ~/.profile .env 2>/dev/null

If both commands print nothing, no key is hiding in your shell. Then start Claude Code and ask it to explain what it sees, using this prompt:

In two short paragraphs, explain how Claude Code decides between an ANTHROPIC_API_KEY and my /login subscription, and list the files where a forgotten key could be set on this machine. Do not read or print any key values.

Then type /status yourself and compare its Login method row with what Claude described.

Common Mistakes

  • Running /login again and again. While an approved key is set, it still takes priority, so a fresh login doesn’t change anything.
  • Unsetting the key in one terminal, then starting Claude Code from another window or an IDE terminal that still loads it.
  • Forgetting the project’s .env file, which some shell plugins load automatically.
  • Assuming your subscription was cancelled and contacting billing first, when the problem is a local variable.
  • Fixing the interactive app but not the CI job, where claude -p always uses a key that is present.

Pro Tips

  • Keep API keys out of your global shell profile. Load them only in the project or job that needs them.
  • Answer No at the “Detected a custom API key” prompt unless you mean to bill that key’s organization.
  • After any change, run /status once. It is the quickest way to see which credential is active.
  • Rotate or delete keys from old jobs in their Console as soon as you leave, so nothing stale lingers.
  • Keep our environment variables guide handy to know which variables Claude Code reads.

Organization Disabled Error Cheat Sheet

Cheat sheet for the Claude Code This organization has been disabled error with commands to find the key and fix it
Save this card: how to find a stale key and switch back to your subscription.

Frequently Asked Questions

Does “this organization has been disabled” mean my Claude account is banned?

Usually not. The docs tie it to an old ANTHROPIC_API_KEY from a disabled Console organization. Remove the key and your subscription login normally works again.

I never set an API key. Why do I see this?

Something may set it for you, such as a line added to ~/.zshrc years ago, a project .env file loaded by direnv, or the env block in a settings file. Run env | grep ANTHROPIC to check.

Why does claude -p fail when the interactive app works?

In non-interactive mode, Claude Code always uses ANTHROPIC_API_KEY when it is present. The interactive app may be using your login because you once answered No at the key prompt.

Can I re-enable the disabled organization myself?

Only the organization’s admin or Anthropic support can restore it. If you just want Claude Code working, switch to your own subscription or a key from an active organization.

Is this the same as “Your organization has disabled API key authentication”?

No. That message means an admin turned off API keys for an organization that is still active. The fix is similar, though: remove the key and sign in with /login.

Conclusion

The “API Error: 400 … This organization has been disabled” message in Claude Code nearly always comes from a leftover ANTHROPIC_API_KEY that points to a Console organization that is no longer active, and because that key outranks your /login credentials, a perfectly good subscription looks broken. Find the key with env | grep ANTHROPIC, run unset ANTHROPIC_API_KEY, delete the line from your shell profile or .env file, and confirm the result with /status. In our demo, removing the key was all it took for the same prompt to succeed through the subscription login. To learn more about Claude AI and its tools, browse the rest of our guides.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top