AI workflows are expensive. Put a gate in front of them.
GreenGate supervises active jobs so no account can overspend.
The problem
Metering tools cannot stop jobs once limits are reached.
Jobs continue to run even after limits are exceeded.
The limit only answers the next request. Metering and billing see the spend after it happens. Nothing stands in front of the work itself.
One customer account's AI workload against a fifty dollar balance. Twenty one jobs are admitted. Every job is checked against the balance, and the balance only changes when a job closes and reports what it cost, so a job that is still running is invisible to it. Eighteen jobs close, late and in a rush. Three open ended agents never close at all. The real balance runs out while the balance every check reads still shows forty one dollars thirty nine available. By the end the visible balance is nineteen dollars eighty overdrawn and the true figure is eighty eight dollars forty eight.
Balance every check sees
$50.00
Behind by
$0.00
Balance actually left
$50.00
One customer account starts work. Every check reads its balance, and finds plenty.
Jobs are admitted faster than they close. Nothing on this sheet has reported yet.
Reports start landing and the balance steps down, always describing work that already ended.
The money actually runs out here. The balance still shows $41.39 available.
The reports pile in at once. The balance catches up in a rush, far too late.
Three agents never close. Nothing attached to them can stop them, and the balance will never know.
GreenGate's Fix
We track usage as it happens.
The same fifty dollar balance as the section above, with every allow now holding its estimate. A code review is allowed and six dollars is held for it before any work runs. Then the same three agents that never closed above, the agent loop, the research agent and the eval sweep, each open a hold and grow it with every usage report, until together they have taken available down to one dollar. All three are stopped there, at eighteen dollars, fourteen dollars and eleven dollars. They settle at what they actually burned. The code review then settles at four dollars fifteen and one dollar eighty five comes straight back, leaving two dollars eighty five available, forty seven dollars fifteen settled and nothing held. Throughout, the balance every check reads is the balance the account actually has left, so the gap that reached sixty eight dollars sixty eight in the section above stays at zero here.
The answer is yes, and the account's money is already spoken for.
The same three agents that never closed, each taking a hold.
Every report grows a hold, so available falls while they run.
Nothing could stop them before. This stops all three on the dollar.
Settling keeps only what the work actually cost.
Every check reads the balance that is actually left.
Any balance
Gate everything you care about.
It doesn't have to be money.
The same balance readout shown in six units: dollars, credits, tokens, GPU minutes, video seconds and agent runs. Only the quantity and its unit change. The instrument, the hold and the decision are identical in every case.
How it works
You send a request.
We check it against your rules.
Usage is reserved per job before it runs. Each request only sees what is available.
the request
estimated usage
your rules
the answer
Integrate
Integrate before lunch.
One line of Python governs every OpenAI and Anthropic client in the process.
Plain REST covers everything else.
import greengate as gg
gg.init(auto_instrument=True)
# every OpenAI and Anthropic client is now governed
# or guard any unit of work explicitly
with gg.guard("chat", org="acme-ai",
quantities={"output_tokens": "4000"}):
run_the_work()
# clean exit commits · an exception releases the hold
# 1 · ask before the work runs
curl -X POST $ENGINE/governance/check \
-d '{ "org_external_id": "acme-ai", "service_key": "chat",
"quantities": { "output_tokens": "4000" }, "session": {} }'
# → { "allowed": true, "reservation_id": "res_8f3a",
# "estimates": { "usd_credit": "2.00" } }
# 2 · report while it streams, obey the verdict
curl -X POST $ENGINE/reservations/res_8f3a/reserve \
-d '{ "seq": 1, "delta": { "output_tokens": "9000" } }'
# → { "verdict": "continue", "headroom": { "usd_credit": "9.50" } }
# 3 · settle at what actually ran
curl -X POST $ENGINE/reservations/res_8f3a/commit
# → { "status": "committed", "actuals": { "usd_credit": "13.50" } }
Python SDK and plain REST + SSE today
Early access
Supervise your workflows.
We are inviting a small group of teams to test GreenGate and help shape the product. Tell us what you meter and where spend control gets difficult, and we will set up a sandbox with you. We look forward to hearing from you.
Prefer email? greengate@bandit-labs.com