Your agent pays per call. What stops it paying forever? This tiny library does: set a daily cap per wallet + endpoint, and any call that would exceed it is blocked before the payment happens. Client-side only — no server, no account, no trust in us required.
| Rule | Detail |
|---|---|
| Priced at list price | Every call counts at the endpoint's list price — even free-trial calls. Conservative on purpose: your budget math never depends on a trial being active. |
| Local ledger | Spend is tracked in ./spend-ledger.json on your machine, keyed by wallet + endpoint + UTC day. Nothing is sent anywhere. |
| Block before pay | check() runs before the paid call. Over cap → a clear SPEND CAP BLOCKED error with the exact remaining budget. No partial payments, ever. |
| Reset | The day bucket is UTC. Yesterday's spend never blocks today's calls. |
loading…
Raw: GET https://api.mekongtradeintel.com/clinic/guard?lang=js
loading…
Raw: GET https://api.mekongtradeintel.com/clinic/guard?lang=python
The code generator can emit any endpoint's client code with the guard already wired in — tick “Add spend-cap guard” or pass &guard=1 to GET /clinic/codegen. The generated snippet carries a DAILY_CAP_USD constant you set once.
Built by Mekong Trade Intelligence — pay-per-call APIs for AI agents, settled in USDC on Base. Related: 402 Clinic · code generator · buyer ratings.