Docs / Claude guides

How to Revoke a Claude API Key

A Claude API key grants API access to your organization's models and workspaces. Revoke a key when it is compromised, handed off, or assigned to someone who has left. Access stops immediately. Any application still referencing the revoked key starts returning 401 errors right away. Check the key's recent usage first to confirm no live workload depends on it before you act.

In this guide, we'll walk through two methods to revoke a Claude API key:

  • Revoke a Claude API key in the Claude Console
  • Revoke a Claude API key in Admin365

Choose a method

How to Revoke an API Key in the Anthropic Console

You can revoke a Claude API key in the Anthropic Console. Use the Console when a key is compromised, shared accidentally, or no longer in use.

Steps to Revoke an API Key in the Claude Console

  1. Sign in to the Anthropic Console.

  2. In the left sidebar, under Organization settings, click API keys. The API keys page lists every key in your organization, with its workspace, creator, creation date, expiry, and status.

  3. In the Search keys box, type the key's name. On the matching row, confirm the name, workspace, and creator before continuing.

  4. On the key's row, click the More actions button (⋮ at the far right of the row). A menu opens with two options: Disable API key and Delete API key.

API key row with More actions menu open
  1. Click Disable API key. A Disable key? dialog opens and displays the key's name. To remove the key from the list permanently instead, click Delete API key. This is irreversible.

Disable key confirmation dialog
  1. Confirm the dialog shows the correct key, then click Disable.

    The key's row updates to show a Disabled badge. Once disabled, the key stops authenticating API requests immediately. It stays in the list. Use the More actions menu to re-enable or delete it later.

API Key Security Best Practices for Revoking in the Claude Console

  • Before disabling a key, confirm no live workload still references it. Any application using the key will start returning 401 errors the moment the key is disabled.
  • Use Disable rather than Delete when you are unsure of the impact. A disabled key can be re-enabled; a deleted key cannot.
  • After revoking a compromised key, generate a replacement immediately. Update your secrets manager or environment variable before redeploying any connected application.
  • Rotate keys every 30 to 90 days. Create a new key first, then disable the old one. This avoids any service gap during the switch.
  • Assign one key per application environment. Revoking a compromised production key leaves your development and staging environments unaffected.

Common Errors When Revoking a Claude API Key

Errors during API key revocation fall into two categories. Some involve finding the key in the Console. Others involve apps that still reference the revoked key. Match the error text you see to the entry below, then follow the resolution.

Can't Find the API Key to Revoke in the Claude Console

Error:

The API keys list returns no results for your search.

What it means: The keys list is filtered by the Search keys box and paginated, and a just-created key can lag a few seconds before it appears.

Solution: Clear the Search keys box and refresh the API keys page. Wait a moment, then re-type the exact key name to filter the full list.

401 Unauthorized Error After Revoking a Claude API Key

Error:

{"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}

What it means: An app or the ANTHROPIC_API_KEY environment variable still references the key you revoked, so its next request fails authentication.

Solution: Create a replacement key in the Console. Update every app and secret store (including ANTHROPIC_API_KEY) to the new value, then clear any cached credentials.

403 Permission Error After Replacing a Revoked Claude API Key

Error:

{"type":"error","error":{"type":"permission_error","message":"Your API key does not have permission to use the specified resource."}}

What it means: The replacement key was not assigned to the same workspace as the revoked key, so calls that previously worked now lack access.

Solution: In the Console, assign the replacement key to the correct workspace. You can also use an organization-scoped key so it has permission to the resource.


Govern Claude API Keys with Admin365

Find and revoke stale Claude API keys across every workspace in one pass.

Download Admin365