How to cap and control AI spend in an engineering organization
AI in engineering
CTO
- Published
- Reading time
- 5 min read
The three mechanisms we run from day one to keep AI spend bounded: per-person plans for developer tools, a fixed monthly budget per product feature with alerts at 70, 90, and 100 percent, and an automatic shut-off when a day's spend passes roughly five times the daily mean.
Most engineering organizations we talk to can’t say what they spent on AI last month without pulling several invoices and a cloud bill. The coding assistants went on a company card. A product feature calls a model API that bills per token, and that number moves with whatever customers did that week. Nobody set a ceiling, because nobody treated it as a budget line until it had become one.
We run AI under an operating model, and the cost part of that model is short: three mechanisms, all active from the first day. This page states them with the thresholds we use. The whole model, with the exit ramps, the data tiers, and the gated program, is in Running AI under governance; this page is its spend section on its own, with the details filled in.
Where does AI spend land?
The first is developer tooling: coding assistants, review agents, whatever the engineers use to build the software. We buy it per seat. Each seat has a list price, so finance knows the base monthly cost before anyone logs in. It scales with the size of the team.
The second is product AI: any feature in the software you ship that calls a model. On a usage-priced model API that line bills by the token, so it moves with traffic, with the length of what users send, and with the model behind the feature. Left alone it has no ceiling at all. One customer pasting a long document into a feature that summarizes it can cost more in a day than the feature was expected to cost in a month.
Per-person plans for developer tools
Buy each engineer a priced seat on a per-person plan, and don’t use shared or pay-as-you-go keys for routine tooling. Where the plan bills usage beyond what the seat includes, cap that paid usage per person or switch it off; paid usage can be on by default. The most the team can spend is then seats times price plus any caps, and a new hire adds one known maximum.
With paid usage capped or off, the vendors’ bill for a whole engineering team is a few hundred dollars a month, and it stays under roughly a thousand a month even at full rollout. At each gate we remove any seat unused for the whole period since the last gate and keep only the tools that improved measured delivery.
A fixed monthly budget per product feature
Each product AI feature gets its own fixed monthly budget, set before the feature ships. One budget per feature, because a shared budget hides which feature is drifting.
Alerts fire at 70, 90, and 100 percent of the month’s budget. At 70 percent an engineer looks at the curve. At 90 percent an engineer decides whether what is left in the budget covers the rest of the month or the feature needs throttling. At 100 percent the feature stops calling the model for the rest of the month and falls back to whatever the product does without it. A person approves each budget increase.
We build the core workflow to work without AI first and add AI to fill in gaps, so a feature that reaches its ceiling degrades to the non-AI path. Without that fallback a hard cap would take the feature down on the day the budget ran out, so we design the cap and the fallback together, and a feature with no fallback goes back to design before it gets a budget.
An automatic shut-off when daily spend spikes
Monthly budgets catch drift. A spike needs a daily mechanism, because if a retry loop goes wrong or a customer scripts against the feature, a feature that normally spends a small fraction of its budget per day can burn the whole month’s budget before anyone looks.
So the daily shut-off watches each feature’s daily spend against its daily mean, and switches the feature off automatically when today’s spend passes roughly five times that mean. The alert goes out, the feature falls back, and an engineer turns it back on after finding the cause.
Legitimate traffic can cross that band too, so the shut-off is a signal to investigate.
What does the baseline say about the spend?
Before the program scales, we measure the team’s pace and quality without AI, so there is a number to compare against. The program then runs through a 30-day checkpoint and a 90-day gate, each with written go or no-go criteria, and at each gate we put the spend next to what it bought. If the tooling seats aren’t showing up as faster delivery at the same quality, we remove the seats. If a product feature’s cost per use doesn’t hold against what the feature is worth to the business, we re-scope the feature or switch it off. What makes AI project management different in practice covers the baseline for the feature itself: what the existing, simpler approach already delivers.
Is “percentage of code written by AI” a good metric? What to measure instead explains what goes into the team’s baseline, and why a percentage of AI-written code is not part of it.
What happens when a vendor raises its prices?
Vendors raise prices. All three mechanisms hold when they do, because none of them depends on a price staying put.
A seat price increase changes one known monthly ceiling into another; the per-seat plan makes the new one arithmetic. When a vendor moves usage out of the seat and onto a meter, the per-person cap bounds what that adds. A model price increase on the product side shows up as the 70 percent alert arriving earlier in the month, which is the signal to look at the cost per use and decide whether to keep the model or swap it.
Whether you can swap the model at all is an architecture question, answered on How to avoid AI vendor lock-in with a model-neutral architecture.
Frequently asked questions
What alert thresholds should an AI feature budget have?
We set three, at 70, 90, and 100 percent of the feature's fixed monthly budget. At 70 percent an engineer looks at the curve. At 90 percent an engineer decides whether the rest of the month fits. At 100 percent the feature stops calling the model until the month resets or a person raises the budget.
How do you stop a runaway AI bill overnight?
Watch each feature's daily spend against its daily mean. When a day's spend passes roughly five times that mean, shut the feature off automatically. The feature falls back to its non-AI path, and an engineer turns it back on after finding the cause.
Should engineers share one API key for AI coding tools?
No. Buy per-person plans. If a plan bills usage beyond the seat, cap that paid usage per person or switch it off. A shared pay-per-use key has no per-person ceiling, no per-person accountability, and a bill that is hard to forecast.
How do you know AI spend is paying off?
Before scaling, measure the team's pace and quality, then compare at a 30-day checkpoint and a 90-day gate with written go or no-go criteria. At the gate, we cut spend that hasn't improved the measured outcomes.
- ai
- governance
- engineering-leadership
- risk
CTO
Srđan Marković is the CTO of Red Black Tree. He writes about running AI in an engineering organization under governance, developer security and the operating decisions behind both.