Anthropic integration

Anthropic Claude API spend alerts and brakes

Costbrake reads your Claude API usage and cost reports with an Anthropic Admin key every 5 minutes on Pro and Team, and every minute for 2 hours after a spike alert. Its two brakes set one API key, or up to 60 active keys in a workspace, to inactive, and Undo switches exactly those keys back on.

Anthropic has no read-only Admin key, so the same key reads usage and runs the brakes. The Free plan checks hourly and alerts by email; brakes come with Pro at $12 a month and Team at $39 a month (see pricing), and an admin starts every brake by hand.

Anthropic at a glance

Reads
Usage report per hour, priced at list prices, then the cost report's billed dollars per day
Key
One Admin key (sk-ant-admin01-), used for reads and brakes; Anthropic has no read-only option
Setup
Paste the Admin key on the connect page, or on the page your coding agent sends
Free plan
Checks every hour, email alerts, no brakes
Pro and Team
Checks every 5 minutes, Slack, Discord and webhook alerts, brakes
Spike checks
Every minute for 2 hours after a spike alert
Brakes
Disable API key, Disable workspace keys

Brakes

2 brakes for Anthropic

An admin picks a brake, confirms it, and can undo it later. Brakes come with Pro and Team.

  • Admin confirms

    Disable API key

    Sets one API key to inactive, so requests made with it stop working; nothing else changes.

    UndoSets the API key back to active.

    Other keys keep working, so a script that holds a second key needs that key braked too.

  • Admin confirms

    Disable workspace keys

    Sets every active API key bound to the workspace to inactive, up to 60 keys per brake.

    UndoSets exactly the keys this brake disabled back to active; a key archived or expired since then stays off.

    Organization-wide keys and Console usage keep working, and keys past the first 60 have to be switched off in the Claude Console.

Can you set a hard spending limit on the Claude API?

Yes, at three levels. The Start, Build and Scale usage tiers each carry a monthly spend cap: $500, $1,000 and $200,000. Below that, you can set your own organization limit on the Billing page in the Claude Console, and a limit per workspace. When usage reaches a limit you set, requests return HTTP 400 with invalid_request_error. When the organization hits its tier cap, requests return HTTP 429 with rate_limit_error until 00:00 UTC on the first day of the next month.

ControlSet whereWhat stopsHow it ends
Tier spend capBy Anthropic: Start $500, Build $1,000, Scale $200,000 a monthAll API usage, with HTTP 429The first of next month at 00:00 UTC, or a higher tier
Organization spend limitBilling page, below the tier capAll requests, with HTTP 400Raise or remove the limit
Workspace spend limitPer workspace, never the default oneThat workspace's requests, with HTTP 400Raise or remove the limit
Costbrake key brakeCostbrake, by your adminOne key, or up to 60 keys in a workspaceUndo sets them back to active

The gaps: you can't set a spend limit on the default workspace, and a monthly limit set at your real budget still lets a leaked key spend that whole budget first. How to cap your Claude API spend covers each setting.

What Costbrake reads from Anthropic

Costbrake pulls the usage report in hourly buckets, split by model, workspace, service tier, speed and inference region, and fills the current hour from minute buckets when the hourly report has not caught up. It prices those tokens at list prices, including cache writes and reads, Batch, fast mode and US-only inference, to estimate live spend. The daily cost report then replaces the estimate; Costbrake refreshes it every 3 hours.

Anthropic says usage and cost data typically appears within 5 minutes of a request finishing, though it can take longer. Priority Tier usage shows as tokens with no extra cost, and Anthropic's cost report leaves Priority Tier costs out too. Code execution and Managed Agents session charges only appear in the daily billed costs.

Which Anthropic key does Costbrake need?

An Admin key from Settings, Admin keys in the Claude Console. Only organization members with the admin role can create one, and the Admin API is unavailable for individual accounts, so set up an organization first. Console Admin keys have no selectable scopes: every key has full access to the endpoints that accept Admin keys. The secret starts with sk-ant-admin01- and Anthropic shows it only once.

Because the key can switch API keys off, store it like any admin credential. Costbrake only uses it to change a key's status when your admin runs a brake. If a coding agent sets up Costbrake through agent setup, it sends you a connect page and you paste the Admin key there yourself.

How the Anthropic brakes work

  1. An admin turns on the killswitch for the Anthropic connection. No second key is needed.
  2. Costbrake lists your workspaces and API keys with their status, read from the Admin API.
  3. The admin picks one key or one workspace and types the connection's name to confirm.
  4. Costbrake sets the key, or every active key bound to that workspace, to inactive.
  5. Undo sets exactly those keys back to active. Keys that were archived or expired in the meantime stay off.

Costbrake refuses to brake a key that is already inactive, archived or expired, and it never deletes or archives a key.

What Costbrake can't do on Anthropic

  • Stop spend on its own. Alerts are automatic; a brake always waits for an admin.
  • Change your Anthropic spend limits. The brakes switch API keys off and on; your limits stay as you set them.
  • Stop Console usage or organization-wide keys with the workspace brake.
  • Show Priority Tier cost, or code execution and Managed Agents session charges, before the daily cost report.

If a key has leaked, brake it first and rotate it after. What to do in the first hour after an API key leaks has the full order, and How Claude API credits work explains what happens when prepaid credits run out.

Questions and answers

Does Anthropic have a read-only Admin key?

No. Claude Console Admin keys have no selectable scopes, so every Admin key has full access to the endpoints that accept Admin keys. Costbrake uses it to read usage and cost reports, and to switch API keys off and on only when an admin runs a brake.

Does Costbrake disable Claude API keys automatically?

No. Costbrake sends spike, budget and forecast alerts automatically, but a brake only runs when an admin of your Costbrake workspace picks a key or workspace and types the connection name to confirm.

How fast does Costbrake see Claude API spend?

Anthropic says usage data typically appears within 5 minutes of a request. Costbrake checks every 5 minutes on Pro and Team, every minute for 2 hours after a spike alert, and every hour on Free.

What error does the Claude API return at a spend limit?

A spend limit you set returns HTTP 400 with invalid_request_error, and the message starts with "You have reached your specified API usage limits". The tier's monthly cap returns HTTP 429 with rate_limit_error and the error code enforced_spend_limit_reached.

Can Costbrake connect an individual Claude Console account?

No. Anthropic's Admin API is unavailable for individual accounts, and Costbrake needs an Admin key. Set up an organization on the Organization page in the Claude Console, then create the Admin key as an organization admin.

Sources

Updated

Start with 14 days of Pro, free

Catch the next Anthropic spike before the invoice.

14 days of Pro, then Free for 2 accounts. No card needed.