What Costbrake reads from each AI provider
Each connection uses a key that can read usage and billing. Brakes need write access: for OpenAI, OpenRouter, xAI and Google Cloud you add a separate key for the killswitch, while Anthropic's Admin key reads and brakes with the same key.
| Provider | What Costbrake reads | How fresh | Brake an admin can use |
|---|---|---|---|
| OpenAI | Usage and cost per project and model, with a read-only Admin key | Usage every 2 minutes; OpenAI lags a few minutes | Freeze one project, or the whole organization, at a $0.01 hard limit |
| Anthropic | Usage and cost reports per workspace and model, with an Admin key | Usage within about 5 minutes | Turn off one API key, or every key in a workspace (up to 60) |
| OpenRouter | Spend per key, with a read-only management key or the one key you watch | Spend every minute | Disable a key, or set its credit limit to $0 |
| xAI | Hourly cost per model and API key, with a management key that can only read usage | Every 2 minutes | Disable a key, or set the invoiced billing limit to $0.01 |
| Gemini (Google Cloud) | Your Cloud Billing export to BigQuery, plus live estimates from Cloud Monitoring | Export a few hours behind; live estimates about 5 minutes behind | A zero spend cap on the Gemini API in one project, not instant |
On Pro and Team, a spike puts the connection on fast checks for 2 hours: every minute for Anthropic and OpenRouter, every 2 minutes for OpenAI and xAI. Free checks every hour. The plan limits are on the pricing page. Setup and brakes for each provider are on the OpenAI, Anthropic, OpenRouter and xAI pages.
Which alerts fire, and where they go
The spike rule is on for every connection from the start. It fires when an hour costs more than 3 times the usual hourly spend of the past 7 days and at least $5 more than that. At 10 times the usual hour the alert is marked critical. The rule also checks the hour in progress, so a key that starts burning money partway through the hour does not wait for it to close.
- Budgets for the whole workspace or one connection work on every plan and alert at 50, 80 and 100 percent. Pro and Team can also budget one provider, service or project.
- Forecasts (Pro and Team) tell you when the month is on pace to go over a budget.
- New charges (Pro and Team) flag the first charge of $1 or more from a model or project with no recent spend, once a connection has a week of data.
Free sends alerts by email. Pro adds Slack, Discord and webhooks, and Team adds PagerDuty, so the alert lands where the person who owns the key will see it.
Braking a key or a project
A brake is a click by an admin, never a rule. The killswitch stays off until an admin turns it on for a connection, each brake asks you to type the connection's label before it runs, and the request is written to the audit log first. Every brake has an undo that puts the old setting back.
- OpenAI: the project's monthly hard spend limit drops to $0.01. Once OpenAI enforces it, usually within minutes, paid requests in that project fail with
429 project_spend_limit_exceeded. Other projects keep working. - Anthropic: the key goes inactive and every request made with it fails right away. The workspace brake does the same for up to 60 keys; organization-wide keys and Console usage keep working.
- OpenRouter: disable the key, or set its credit limit to $0 so paid requests fail while free models still work.
- xAI: disable the key, or set the invoiced billing limit to $0.01. Prepaid credits keep being used until they run out, so on prepaid billing the key brake is the one that stops requests.
- Gemini: a zero spend cap on the Gemini API in one Google Cloud project. Google pauses new usage once its cost estimate passes the cap; that is not instant, and usage until then is still billed.
Brakes come with Pro and Team. A new workspace starts on a 14-day Pro trial with no card, so the brake works from the first day.
Native caps on each provider, and what they miss
Every provider has its own control, and each one lives in its own console:
- OpenAI bills prepaid credits, and auto-reload is turned on by default during setup. See OpenAI API spending limits.
- Anthropic caps each tier's monthly spend, $500 on Start and $1,000 on Build, and lets you cap a workspace, but not the Default Workspace. See Claude API spending limits.
- OpenRouter sets credit limits per key. See OpenRouter key limits.
- xAI takes usage from prepaid credits, and auto top-up buys more when the balance drops below a threshold. See xAI API spending limits.
- Gemini has monthly spend caps per billing account tier and per project, and Google says you can overrun a project cap for around 10 minutes. See Gemini API spending limits.
These caps stop spend at a fixed number. They don't tell you when one key starts burning 10 times its normal rate, and they never show five providers on one screen. If you want to watch AI spend by hand first, how to monitor AI API spend walks through each provider's usage API. Gemini spend comes in through the Google Cloud integration. For agents that run up API bills, see coding agent spend, and for a key that leaked, leaked API key protection.
Questions and answers
Can Costbrake track Gemini API spend?
Yes, through a Google Cloud connection. Costbrake reads your Cloud Billing export to BigQuery, which usually runs a few hours behind, and adds live estimates from Cloud Monitoring for the Gemini API, about 5 minutes behind. The Gemini brake sets a zero spend cap on the Gemini API in one project; Google applies it once its cost estimate passes the cap, so it is not instant.
Does Costbrake sit between my app and the AI provider?
No. There is no proxy, no SDK and no code change. Costbrake reads usage and cost from each provider's own API with a key you create for it, so it sees spend from every key and app in the account. It is as fast as the provider's usage data: OpenAI lags a few minutes and Anthropic about 5 minutes.
Which AI providers can Costbrake brake at the key level?
Anthropic, OpenRouter and xAI can switch off a single API key, and Anthropic can also switch off every key in a workspace. OpenAI brakes work on a project or the whole organization through its hard spend limit. Gemini is braked with a zero spend cap on the Gemini API in one Google Cloud project.
Will Costbrake switch off my key without asking?
No. Alerts go out on their own, but a brake only runs when an admin clicks it and types the connection's label to confirm. Members of the workspace cannot use brakes; admins and owners can.
How much does Costbrake cost for tracking AI API spend?
Free covers 2 accounts with hourly checks and email alerts. Pro is $12 a month or $120 a year for 10 accounts, 5-minute checks, Slack, Discord and webhook alerts, and brakes. Team is $39 a month or $390 a year for 50 accounts, PagerDuty, the REST API and unlimited seats. New workspaces get 14 days of Pro with no card.
Sources
Updated