LLM Spend TripwireChecklistCodeHosted waitlist

Claude API key stolen? What to do in the first hour

From Swift Labs, makers of LLM Spend Tripwire. Written with AI help and checked against the sources linked below on November 16, 2026. Swift Labs isn't affiliated with Anthropic. This is general information, not security or legal advice.

If someone else has your Claude API key, they can run up charges on your account. Anthropic's help center compares an API key to a credit card number: if someone gets it and uses it, "they incur charges on your behalf" (source). Work through these five steps in order. Each one links to the Anthropic page it comes from.

The short version

  1. Disable or delete the key on the API keys page in the Claude Console.
  2. Check the Usage, Cost and Logs pages to see how much was used and when.
  3. Set or lower your monthly spend limit.
  4. Put a new key everywhere the old one was used, and find out how it leaked.
  5. Contact Anthropic support with the key name, the time window and what you found.

1. Disable or delete the key

Sign in to the Claude Console and open the API keys page (platform.claude.com/settings/keys). Anthropic's advice for a key you think is compromised is to revoke it right away: click the menu (the three dots) next to the key and select Delete API key (source).

You have two options, and Anthropic lists both for a key you suspect has leaked (source):

If you're not sure which key leaked, disable every key that could be it, then delete the leaked one once you know. Any app still using that key will stop working until you give it a new key in step 4.

If the leaked key starts with sk-ant-admin01-, it's an Admin API key, not a regular API key. Admin keys live on a separate Admin keys page (platform.claude.com/settings/admin-keys). They have no scopes: Anthropic says "every key has full access to the endpoints that accept it", and the Admin API manages organization members, workspaces and API keys (source). Remove that key too, then check your members, workspaces and API keys for changes you didn't make.

If the key was in a public GitHub repository, Anthropic may already have acted. Anthropic is a GitHub secret scanning partner: GitHub scans public repositories for Claude API keys and notifies Anthropic, which "automatically deactivates the exposed API key" and emails the affected user (source). That covers public GitHub repositories. A key that leaked anywhere else won't be caught this way, and even after that email you still need the rest of this list.

2. Check Usage and Cost to see what happened

In the Claude Console, look at:

Anthropic recommends reviewing the Logs and Usage pages for your API keys (source). Write down:

You'll want these notes for step 5.

For a per-key breakdown, use Anthropic's Usage and Cost API. It can group usage by API key and model in 1-minute, 1-hour or 1-day buckets, and data "typically appears within 5 minutes" of a request. It needs an Admin API key, or a personal or service account key that isn't scoped to a workspace; workspace keys don't work, and individual Console accounts without an organization can't use it (source). If you create an Admin key just for this, pick a short expiration such as 3 hours and delete it when you're done, because every Admin key has full access (source). Cost data from that API is daily only, in USD (source). For example, hourly usage by key and model for one day:

curl "https://api.anthropic.com/v1/organizations/usage_report/messages?\
starting_at=2026-11-15T00:00:00Z&\
ending_at=2026-11-16T00:00:00Z&\
group_by[]=api_key_id&\
group_by[]=model&\
bucket_width=1h" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

Change the dates to cover your time window. Two things to know: usage from the playground in the Claude Console has no API key ID, and usage in the default workspace has no workspace ID (source). Anthropic calls this API "legacy" but says it "remains supported"; for new integrations it recommends the newer Usage and Cost Analytics API.

3. Set or lower your spend limit

A spend limit caps what anyone, including someone with a key you haven't found yet, can spend in a month.

  1. Open Spend limits in the Claude Console (platform.claude.com/settings/spend-limits).
  2. Next to your organization's Monthly spend limit, click Adjust limit or Set limit.
  3. Enter a new value. It can't be higher than your usage tier's cap.

If you don't see Spend limits, an older help-center article points organizations with custom rate limits to the Billing page instead (source).

(source)

When usage reaches a limit you set, API requests fail with an HTTP 400 error until access resumes or you raise the limit. That includes your own apps, so pick a number you can live with.

Each usage tier also has its own monthly spend cap: $500 for Start, $1,000 for Build and $200,000 for Scale. Custom-tier organizations have no monthly cap (source).

Workspace limits. You can also set custom spend and rate limits for each workspace, except the default workspace, which can't have its own spend limit. Organization-wide limits always apply (source).

Auto-reload. If your account tops up prepaid credits automatically, look at the auto-reload settings on the Billing page (platform.claude.com/settings/billing). Anthropic says auto-reload limits also act "as a safeguard against unexpected high usage that could result from leaked keys" (source). Until you've found the leak, consider lowering the auto-reload amount so a stolen key can't keep topping up your credits.

4. Rotate keys everywhere and find the leak

Create the new key. On the API keys page, click Create key, name it and pick an expiration (source). Expiration options are 3 hours, 1 day, 7 days, 30 days, a custom duration, or Never. You can't change the expiration later. For a production service, Anthropic suggests a service account key rather than a personal one, so the key doesn't act as one person.

Put it everywhere the old key was. That's usually the ANTHROPIC_API_KEY environment variable or a secrets manager entry. Confirm requests succeed, then delete the old key (source). If you only disabled the leaked key in step 1, delete it now. Store the new key in a secrets manager, not in your code or version control (source).

Rotate whatever sat next to it. If the key leaked from a .env file, a CI system or a shared tool, other secrets in the same place were probably exposed too.

Find out how it leaked. Common places to check:

Turn on secret scanning. Anthropic recommends enabling secret scanning in your source control provider, using a tool such as Gitleaks, and scanning in CI before code reaches your main branch (source). GitHub's secret scanning recognizes Anthropic API keys and Admin API keys (source), and GitHub Advanced Security customers can scan for and block Anthropic keys in private repositories (source).

5. Contact Anthropic support

Anthropic's compromised-key article says to contact support if you keep seeing suspicious activity or have other concerns (source). To reach support for the Claude API or Console (source):

  1. Sign in to the Claude Console.
  2. Click your initials or name in the lower left corner and select Get help.
  3. In the support messenger, click Send us a message. You'll chat with Fin, Anthropic's AI support bot, first. If your issue needs more investigation, Fin passes it to the Product Support team, and their reply comes in the same conversation and by email.

Console Admins can reach the human support team. If you're not an admin, an Owner or Console Admin in your organization has to escalate for you. Support is in writing only, and Anthropic asks for one conversation per issue.

What to include:

About the charges. Anthropic's Commercial Terms say the customer "is responsible for all activity under its account" and "will promptly notify Anthropic" if it believes its account has been compromised (source). We couldn't find a published Anthropic policy on refunds for usage from stolen keys. Ask, but whether any charges are adjusted is Anthropic's decision.

After the first hour

Our free, open-source LLM Spend Tripwire is a Cloudflare Worker you run yourself that reads your usage with an Anthropic Admin key and can alert Slack or Discord when a key's usage spikes. Its source code is on this site under the MIT License.

Sources

Checked on November 16, 2026.

We haven't walked through these Console steps in a live Anthropic account; the button and page names above are the ones Anthropic's docs use. If something has changed, tell us at swiftlabs-ops@agentmail.to.