How to control AI spend with a per-workspace cost ledger
AI features die from unpredictable bills as often as from bad output. A per-workspace cost ledger — preflight before the call, record after — is how you leave the agent running without fearing the invoice.
By Dmitrii SelikhovFounder
Key takeaways
- AI features get switched off as often for cost as for quality: a model call on every event, multiplied by a busy day, becomes a bill that arrives after the money is spent, and the reflex fix — disabling the feature — means it triages, drafts, and summarizes nothing.
- A per-workspace cost ledger fixes this with a two-part pattern: a preflight budget check before every model call that refuses to spend past the workspace's ceiling, and a post-spend record after each call that accounts for exactly what it cost — boring, and the difference between a feature you leave on and one you fear.
- Metering per workspace (not just globally) is what makes the control fair and legible: each tenant sees its own AI cost, a runaway prompt in one workspace can't burn another's budget, and the spend is attributable rather than a single opaque company-wide total.
- Heavy users should be able to bring their own gateway key so model usage rides their own provider contract — no surprise bill from you, costs billed directly to them — which turns AI cost from a liability you absorb into a transparent line each customer controls.
Most postmortems on dead AI features blame the output — it hallucinated, it was wrong, users didn't trust it. But a quieter killer takes down just as many: the bill. A feature that's delightful in a demo can be a budget grenade at scale, because a model call that fires on every event is a per-event cost multiplied by your busiest day, and nobody budgeted for the busiest day. The team's reflex when the invoice lands is to switch the feature off — and a triage agent that's been disabled out of cost-fear triages nothing. Controlling AI spend isn't a finance chore bolted onto the agent. It's what lets the agent stay turned on.
Why uncapped AI spend is uniquely dangerous
Traditional software costs scale with infrastructure you provision deliberately — you add servers, you see the line item, you decide. AI cost is different because it scales with usage you don't fully control and pay for after the fact. A loop in a prompt, a spike in inbound volume, a single expensive task accidentally run a thousand times — each is a real, uncapped charge that you only discover when the statement arrives, by which point the money is gone. There's no natural ceiling; the model will happily keep answering for as long as something keeps asking, and 'something keeps asking' is exactly the failure mode automation is prone to.
That's what makes uncapped AI spend organizationally toxic. It's not just the dollars on one bad month — it's that one unforecastable bill teaches finance to distrust the entire category. After it happens once, every AI request is treated as a risk, budgets get capped at zero, and the impressive features never ship to the people who'd benefit. The fix has to be structural: the system itself must be unable to spend past a limit, so 'how much could this cost us?' has a hard answer instead of a shrug.
The pattern: preflight, then record
A cost ledger is two boring operations wrapped around every model call. Before the call, a preflight check: does this workspace have budget left? If not, the call doesn't happen — the system returns a clear 'budget exhausted' result instead of spending money it was told not to. After the call, a record: the actual spend is written to the ledger so the running total is always current and the next preflight is accurate. Preflight gates, record accounts. That's the whole mechanism, and its boringness is the point — there's nothing clever to break, just a hard gate that money can't slip past and an honest tally of where it went.
What this buys you is the ability to leave the agent running without holding your breath. The worst case is bounded: a runaway prompt hits the ceiling and stops, rather than billing into five figures before anyone notices. The check is cheap, runs in the call path, and turns 'we might get a scary invoice' into 'we cannot get a scary invoice.' A feature you can't bound is a feature you'll eventually switch off in a panic; a feature with a preflight gate is one you can turn on and forget, which is the only state in which an agent actually earns its keep day after day.
Meter per workspace, not just globally
A single company-wide spend total is better than nothing, but it's the wrong granularity for a multi-tenant product. Meter per workspace, and three good things follow. The cost becomes attributable — you know which tenant spent what, instead of staring at one opaque aggregate. The control becomes fair — a runaway prompt in one workspace hits that workspace's ceiling and stops, and can't quietly consume the budget of every other customer. And the spend becomes legible to the customer themselves — each workspace can see its own AI cost, which is what turns AI from a mysterious vendor charge into a line they understand and can manage.
Per-workspace metering also makes the limits a product surface rather than a hidden backstop. A workspace has a budget; the agent preflights against that specific budget; the spend records against it. When a tier includes a monthly allotment of AI calls, this is how the allotment is actually enforced — not as a marketing number, but as a real gate in the call path. The accounting and the entitlement are the same machinery, which is why building the ledger per workspace is the natural shape: it's both the cost control and the plan enforcement, one mechanism doing both honestly.
Let heavy users bring their own key
For the customers who lean hardest on AI, the best cost control is to take yourself out of the loop entirely: let them bring their own model gateway key. When a workspace supplies its own key, the model usage rides their provider contract directly — they're billed by the provider on their own terms, you're not absorbing or marking up the spend, and there's no surprise bill from you at all. It turns AI cost from a liability you carry into a transparent line the customer owns and watches on their own dashboard. The heaviest users, who'd otherwise be your scariest cost exposure, become the ones whose spend you don't have to manage.
Combine the pieces and AI cost stops being the thing that kills the feature. The per-workspace ledger gives every tenant a bounded, attributable, legible spend with a hard ceiling the system enforces. Bring-your-own-key gives power users a clean pass-through with no markup and no mystery. Both rest on the same principle the rest of agent governance does: make the behavior predictable and visible rather than trusting it to stay reasonable on its own. An agent you can't budget is an agent you'll eventually fear, and a feared feature gets switched off. Build the ledger, and the agent gets to keep working — which was the entire point of building it.