A leaked key should hit a fence, not your whole account.
No major AI provider caps spend per API key — caps live at the project, workspace or billing-account level, if they exist at all. So SPEND/FENCE designs the structure that actually holds: one container per tool, one enforced cap per container, alerts before the wall — and a budget-gate proxy that hard-stops a fence at its cap.
0 OF 3
OpenAI, Anthropic and Google offer no per-API-key spend cap. A copied key spends against the whole container it lives in.
THE CONTAINER IS THE FENCE
Isolate each tool into its own project / workspace / billing scope, cap the container, and one leak = one capped fence.
HARD STOP > ALERT
Billing alerts email you after the money is gone. The SPEND/FENCE proxy returns 429 at the cap — before the charge.
1 · Design your fences
Free: 1 provider, up to 2 fences. Pro: every provider, unlimited fences, exports and the proxy Worker.
3 · Budget-gate proxy (Pro)
Native caps are soft or missing on some providers — the proxy is the hard stop. Each tool gets its own proxy token (so a leaked token only reaches its fence), a monthly cap that is checked atomically before every call, a per-minute call limit and an instant kill switch. Your real provider keys live as Worker secrets, never in the generated code. Streaming is blocked because it cannot be metered. Deploy: wrangler.toml and secret names are at the top of the generated file.
Deploy guide
wrangler.toml, secret setup, how your tools connect, and a test command per fence. Test one fence before you rely on it.
Pro feature. Get Pro below to generate your proxy.
Pro — $19 one-time
Every provider, unlimited fences, Markdown/JSON plan exports, and the budget-gate proxy Worker generated from your plan. One payment, yours forever.
No keys, no setup: when checkout completes, Stripe brings you straight back here with Pro unlocked on this device. Bookmark the page you land on to unlock another device.