Two years ago, a company's AI spend was a credit card with a ChatGPT subscription. Today it is several API keys in production, one OpenAI project per team, GitHub Copilot and Cursor seats, and developers who pay for their own Claude or ChatGPT plan and expense it. Each piece bills on its own, in its own console and on its own cycle. In this article we show how to bring it all together in AAA Sentinel, step by step and with a complete example.
Why AI has become the new runaway bill
The AI bill has the same flaws the cloud bill had ten years ago, plus a few more:
- It is pay-per-use with no cap by default: a badly written loop or an agent that retries forever can spend in one day what used to be spent in a month.
- It is spread across providers that do not talk to each other: OpenAI, Anthropic, GitHub and Cursor each have their own console, their own grouping and their own idea of a budget.
- Part of it never goes through a company console: each person's individual subscription only shows up in expense reports.
- The savings levers are technical and little known: prompt caching, the batch API or choosing a smaller model save a lot, but only if someone looks at the usage data.
What you gain
With AI spend connected and watched, several things change:
- You see spend from every provider in one place, separating what the provider has already billed from what is still an estimate.
- You know which project or workspace is spending, not just how much the organization spends.
- You get concrete efficiency recommendations, with the most they can save at list price.
- You find out before a spend limit runs out, not when the provider starts rejecting requests in production.
- You have an inventory of your team's individual accounts and their list price.
How AAA Sentinel solves it
Everything lives under Connections → "AI connections" and rests on these pieces:
- Organization connections: one admin credential per provider, which the platform uses to read usage and billed cost every day.
- Individual connections: one person's account (their email, their plan and their renewal day), without storing any key.
- AI rules: each connection is evaluated against a set of efficiency, governance and anomaly rules that produce findings with their maximum saving.
- Alerts: spend spikes and limits about to run out go through the same channels as your cloud alerts.
- Agent: on Business, with a separate write key, the agent can propose limits, alerts or revocations, always with human approval.
- Usage agent: a laptop CLI that reports usage of individual Cursor, Claude Code, Copilot and Codex accounts.
Plans: "AI connections" starts on Pro. Pro includes one OpenAI or Anthropic organization connection (a second one is allowed at extra cost) and the efficiency rules. Business includes five organization connections and adds GitHub Copilot, Cursor and OpenRouter, the governance and anomaly rules and the agent actions. Individual Cursor and Copilot connections are already included in Pro.
Worked example: ACME and its AI spend
ACME is a fictional company on the Business plan. It has two OpenAI projects, one Anthropic workspace and six developers with their own subscriptions. This was its September spend, which we will use throughout the article:
ACME · AI spend in September (example)
- OpenAI · project etl-summaries
- 1,100 USD · all on the standard tier, 30 days in a row
- OpenAI · project support-bot
- 420 USD · no spend limit
- Anthropic · workspace product
- 640 USD · uses caching, but rarely hits
- 3 × Cursor Pro (individual)
- 60 USD/month list price
- 2 × Claude Max 5x (individual)
- 200 USD/month list price
- 1 × Copilot Pro+ (individual)
- 39 USD/month list price
Step 1: connect OpenAI and Anthropic with an Admin API Key
Go to "AI connections" and click "Connect AI provider". The wizard has four screens:
- Choose the provider: OpenAI or Anthropic.
- In "Organization or individual?", choose "Organization".
- "Step 1 — Create a read-only key": the link takes you to the provider's admin keys page. In OpenAI it is an organization Admin API Key; in Anthropic, a console Admin Key. A regular API key, the kind used to call the model, will not work. Once you have it, click "I have the key".
- "Step 2 — Connect the key": fill in "Connection name" (for example, OpenAI Production), paste the key into "API key (read-only)" and, if you like, the "Organization ID", which is optional for these two providers. Click "Connect".
The key is validated against the provider before anything is stored. If the provider rejects it because it is not an admin key, the wizard tells you. Anthropic has one more case: an account without an organization has no Admin API; you need to create an organization in the console, even with a single member. In both cases the wizard offers "Connect as individual".
Step 2: Copilot, Cursor and OpenRouter (Business)
Organization connections for these three providers require the Business plan, because the rules they are evaluated against are governance rules. Each one needs a different credential:
- GitHub Copilot: a classic personal access token with the manage_billing:copilot or read:org permission, created by an organization owner. The "Organization ID" is required: it is the organization's login on GitHub.
- Cursor: an admin API key from the Cursor dashboard, with the admin:* scope, created by a team admin.
- OpenRouter: a Management API Key, which is different from inference keys. Instead of the organization ID it asks for the "Workspace ID", which is required: it is the workspace whose budget will be read and, if you enable write access, adjusted.
The first usage data arrives within 24 hours: collection runs once a day.
Step 3: individual accounts
For your team's personal plans, choose "Individual" in the second step of the wizard. No key is needed: just "Holder email", "Provider plan", "Renewal day" (1 to 28) and, if you manage clients, who it belongs to. The platform stores the plan's "List price" from its catalog and adds it to the inventory.
- On an individual account's page, "Declared usage" lets you record the percentage of the quota used in each renewal period. It is the simplest way to know whether an expensive plan is being used.
- In the "AI connections" list, the "People" block groups the individual connections of the same email.
- The platform flags when the same person has two individual connections for the same provider, or also appears in the organization connection: the typical sign of paying twice for the same thing.
At ACME, the six individual accounts add up to 299 USD/month in list price (3 × 20 + 2 × 100 + 39). That is not what the providers bill, but what the plans cost at their published rates.
Step 4: read a connection's page
When you open an organization connection you will find:
- "Billed cost" and "Estimated cost", always separate: the first is the amount the provider has already confirmed; the second, our own estimate of what it has not billed yet. They are never added into a single figure.
- "Daily evolution": spend day by day over the "Period" you choose. This is where you spot a spike before it reaches the invoice.
- "Breakdown": spend per allocation, which is the project in OpenAI and the workspace in Anthropic. This tells you who is spending.
- "Agent write access": where you activate, or revoke, the write key from Step 7.
Step 5: what the efficiency rules detect (Pro)
The efficiency rules read tokens per model inside each project or workspace. Here they are, with their actual thresholds:
- AI-001, underused cache (OpenAI and Anthropic): there are cache writes, but less than 20% of input is served from the cache, with at least 100,000 input tokens.
- AI-002, batch API candidate (OpenAI and Anthropic): at least 2 million tokens over 7 days or more on the standard service tier. The batch API bills at about half the price.
- AI-003, oversized context window (Anthropic only): usage in the 200,000 to 1 million token window with outputs below 2% of the input.
- AI-004, expensive model for a simple task (OpenAI, Anthropic, Cursor and OpenRouter): a high-end model whose output is under 10% of the input.
- AI-005, cache writes not amortized (OpenAI and Anthropic): at least 50,000 tokens written to cache and less than one read per token written.
The saving from these rules is a ceiling, not an estimate: each model's real tokens at its list price, without negotiated discounts, and never above what the project or workspace is billed. It reads "up to X". When the ceiling cannot be guaranteed (an unpublished price, priority traffic, a model with no bill of its own to check against, or one billed above what its tokens cost at list price), the rule warns without a figure.
Governance and anomaly rules (Business)
Business adds rules that do not look for efficiency, but for a missing safeguard or something spiking:
- AI-010 and AI-011: there is real spend, about 10 USD/month or more extrapolated from at least 7 days, with no hard limit (AI-010) or no spend alert at all (AI-011).
- AI-012: an OpenAI, Anthropic or OpenRouter API key with no activity for 30 days or more.
- AI-013, AI-014 and AI-015 (Cursor): spend by people removed from the team; users with no monthly limit, at least 10 USD of usage-based spend in the cycle and above the team average; and spend in the "Unassigned" group, with no billing group.
- AI-016 and AI-017 (Copilot): a Copilot budget does not stop seat license charges; and seats with no activity for 30 days or more (the date depends on IDE telemetry, so it is a hint, not a certainty).
- AI-020: a day whose spend is three times the average of the previous days, with at least 7 days of baseline; from six times the average, with high severity.
- AI-021 (Cursor): automated agents take 15% or more of the team's spend and at least 50 USD/month.
- AI-022: spend in the limit's period (the month, or in OpenRouter also the week or the last full day) is already at 80% or has used it up, or the month-end projection exceeds it.
Step 6: get warned before the limit runs out
AAA Sentinel does not invent its own AI budget: it reads the limit you already have configured at the provider (a project or organization limit in OpenAI, the Copilot budget or the workspace budget in OpenRouter) and compares it every day with month-to-date spend. In OpenRouter, which allows daily, weekly and monthly budgets at once, it compares each one with the spend of its own period (the last full day, since Monday or since the 1st, in UTC); the lifetime budget is not measured. Rule AI-022 fires in three cases: spend is already at 80% of the limit; after at least 5 days of data, the month-end projection exceeds it; or the limit is exhausted, which goes up to high severity because the provider may be rejecting requests (except OpenRouter's daily budget, which is measured on the day already closed).
- The warning arrives as an AI budget alert through the channels configured in Alerts → "Alert channels" (email, Slack, Microsoft Teams or webhook), with the "Spend spikes" toggle on, the same one that governs AI-020 spikes.
- At ACME, etl-summaries has a 1,300 USD limit in OpenAI. On October 10 it has spent 520 USD: at that pace it will close the month at 520 ÷ 10 × 31 = 1,612 USD, above the limit. The alert arrives that day, with three weeks to spare.
Anthropic is outside AI-022, and so is Cursor. Anthropic's Admin API does not expose spend limits or alerts for console organizations, so there is no limit to compare against. Cursor only has per-person limits, which AI-014 already covers.
Step 7: let the agent act for you (Business)
The read key can never change anything. If you want the agent to be able to fix things, go to "Agent write access" on the connection page, paste a second key with write permissions and click "Activate write access". It can be revoked at any time without affecting collection. These are the actions available today per provider:
Agent actions on AI connections
- OpenAI
- Create spend alert (AI-011), set project or organization limit (AI-010), revoke unused key (AI-012)
- Anthropic
- Only revoke unused key (AI-012); it is set to inactive and can be reactivated
- GitHub Copilot
- Revoke inactive seat (AI-017), create budget alert (AI-011), set cap (AI-010)
- Cursor
- Set one person's monthly limit (AI-014)
- OpenRouter
- Set the workspace budget (AI-010), revoke unused key (AI-012)
- Every AI action requires human approval: none runs on autopilot. After approval there is a grace period before execution, for example 24 hours for an OpenAI project limit, 48 for an organization-wide limit or for revoking a Copilot seat, and 72 for revoking a key.
- Revoking a key in OpenAI or OpenRouter is irreversible, and the agent does not revoke keys younger than 30 days.
- At ACME, AI-010 on support-bot leads the agent to propose a limit for that project; an approver enters the figure, approves it and, 24 hours later, the limit is set in OpenAI.
Step 8: the usage agent on the laptop
Individual accounts have no usage API. To find out how much they are used, AAA Sentinel offers a CLI that reads local activity from Cursor, Claude Code, Copilot and Codex. The full guide is under Developer → "Usage agent". On the page of an individual Cursor, Anthropic, Copilot or OpenAI connection, click "Enroll": the token is shown only once. Then, on that person's laptop:
npm install -g @aaa-sentinel/ai-usagesentinel-usage login < token.txtGet-Content -Raw -Encoding utf8 token.txt | sentinel-usage loginsentinel-usage status
sentinel-usage logout- The token goes in through standard input, never as an argument, so it does not end up in the shell history. login schedules the report at sign-in and every hour.
- It only uploads the day, the model and the counters (turns, tokens or requests). The prompt, the code, the conversation and the transcript path never leave the laptop.
- Copilot is read through gh and gives premium requests per model, with no tokens. Codex is only read when the login is a ChatGPT subscription: if it uses an API key, that spend belongs to the organization connection.
- These figures are not converted to dollars or added to billed or estimated cost: they tell you whether a plan is being used.
What it does not do yet
So you know what to expect:
- There is no AI budget defined inside AAA Sentinel: budget alerts compare against the limit configured at the provider.
- In Anthropic, the agent cannot create spend alerts or limits, because its Admin API does not allow it outside Claude Enterprise. AI-010 and AI-011 remain manual guidance.
- Individual OpenRouter connections cannot be added yet.
- The saving from efficiency rules is a ceiling at list price: the real one can be lower, and without a guaranteed ceiling the rule warns without a figure.
- The usage the CLI reports has no amount: Copilot does not give tokens and Cursor only gives counters if its hook provides them.
Checklist to get started
With this in place, the AI bill stops being an end-of-month surprise:
- Pro plan for OpenAI or Anthropic; Business for Copilot, Cursor or OpenRouter, for the governance rules and for the agent.
- One Admin API Key per provider, connected from "AI connections".
- Your team's individual accounts added, with their plan and renewal day.
- A spend limit configured at every provider that supports one, and the "Spend spikes" toggle on in "Alert channels".
- "Agent write access" enabled only on the connections where you want the agent to propose changes.
- The usage agent installed on laptops with expensive plans.