Home / Use cases / agent-spending-limits
Hard spending limits on AI agents — pre-charge enforcement
The problem
Agents loop. Loops cost money. A safety budget that is checked AFTER the call has already gone through is not a safety budget.
What Spawnpay does
Spawnpay's budget option throws BUDGET_DAILY / BUDGET_PER_CALL BEFORE the upstream call. The wrapper short-circuits with a structured error your agent can catch and route around — no money moved, no upstream side effect.
Code
const wrappedFn = paywall(
{ price: 0.001, vendor: 'SP_x', budget: { daily: 5.0, perCall: 0.50, warnAt: 0.8 }, onBudgetWarn: ({ used, daily }) => alert(used + '/' + daily) },
expensiveCall
);
What you get with $7 free credit
Every new spk_ wallet starts with $7. That covers 7,000 proxy calls, 1,400 cloud-scrapes, or 700 screenshots — enough to verify Spawnpay fits your workflow before topping up.