scribase
Agent governance

A real spend cap for an AI agent's API key

Most API keys have a billing alert, not a spending cap: the notification arrives after the money is already spent. A key stolen or leaked by an agent can run up real damage in hours, and a buggy agent loop can do the same to its own owner. The fix needs to live in the request path, pricing and capping the call before it runs, not in an email after the invoice lands.

Last checked November 30, 2026.

Why this is not a hypothetical

A stolen Gemini API key ran up $82,000 in charges in 48 hours before it was caught — the kind of exposure a hard cap would have stopped in minutes, not days. A widely discussed Hacker News thread makes the structural point directly: it is still not possible to put a true hard spending cap on an API key with several major providers — only alerts, which arrive after the spend already happened, or caps that can themselves be beaten by a fast enough loop.

Sources: HN: stolen Gemini API key racks up $82,000 in 48 hours, HN: no hard spending caps on API keys

How Toolgate prices and caps a call before it runs

One sk-t0- key reaches every tool in the catalog — our own products first, then free and public routes, then third-party ones. Every call names its cost in micro-USD up front, before it runs, and a failed call is never billed. That ordering (price known before the call, not after) is what makes a real cap possible: the gate can refuse a call that would exceed the remaining budget instead of discovering the overage on the next invoice. Toolgate is live today and launching on Product Hunt 2026-12-01.

Every call, same shape: price shown, failures never billedbash
curl https://toolgate.scribase.com/v1/tools/scribase.db.query/call \
  -H "Authorization: Bearer sk-t0-..." -H "Content-Type: application/json" \
  -d '{"input": {"sql":"select 1"}}'

Sources: Toolgate catalog (live)

What is live today

2026-11-30: 23 tools behind one key, 18 of them free and 5 priced per call — our own products (database branches, read-only SQL, magic links) alongside free public data routes (SEC filings, legal entity lookups) and third-party ones. Launching Product Hunt 2026-12-01; the catalog above is live today, fetched directly from the endpoint, not a roadmap claim.

FAQ

Questions people ask

Can an AI agent really run up thousands of dollars on an API key before anyone notices?

Yes — a documented case had a stolen Gemini API key rack up $82,000 in charges within 48 hours. The same risk applies to a buggy agent loop calling its own tools repeatedly: without a hard cap enforced before the call runs, the first signal is often the invoice.

Do major API providers support a real hard spending cap?

A widely discussed thread on this exact question concluded no, for several major providers: what exists is an alert that fires after spend has already happened, not a limit enforced before the next call is allowed to run.

How does Toolgate enforce a cap if price has to be known before the call runs?

Every tool in the catalog is priced in micro-USD up front and shown with the call, and a failed call is never billed — so the gate can compare the call's price against the key's remaining budget and refuse it before it executes, rather than discovering an overage afterward. The catalog and this pricing are live today; Toolgate's public Product Hunt launch is 2026-12-01.

How many tools does Toolgate cover, and how many are free?

23 tools behind one key as of 2026-11-30, 18 of them free; the current catalog is always live at toolgate.scribase.com/catalog.md.