If AI agents can spend money, who's holding the credit card?
I built a memory API agents can pay for. The actual problem isn't whether they can pay. It's per-tool caps, per-agent budgets, kill switches, and spend visibility.
TL;DR
- I built a memory API that AI agents can pay for. $0.001 per call in USDC on Base. A typical 4-tool agent loop hits five priced endpoints per turn. A long-running task does this thousands of times a day.
- A single rogue loop drains a wallet in minutes. The real questions: per-tool cap, per-agent budget, how you kill an agent that is spending too fast, and who sees spend by category, agent, and hour.
- Put the controls at the SDK boundary, before the call goes out. Once an HTTP request leaves your process, the money is committed. Gate spend at the call site, not in a billing dashboard you check on Monday.
- Budgets short-circuit with a clean error at the cap. Per-tool caps so one vector query cannot cost $50. Rate limits. A kill switch with a one-line API. Spend visibility per agent, per tool, per hour.
I built a memory API that AI agents can pay for. $0.001 per call in USDC on Base. The demo at bmdpat.com/memory/demo shows real money move in real time.
Cool.
Now multiply that by every paid API your agent stack will eventually consume. Search. Inference. Vector DB. Scrapes. Memory. A typical 4-tool agent loop hits five priced endpoints per turn. A long-running task does this thousands of times a day.
A single rogue loop drains a wallet in minutes.
This is the actual problem. Not "can agents pay?" but:
- What's the per-tool cap?
- What's the per-agent budget?
- How do you kill an agent that's spending too fast?
- Who sees the spend by category, by agent, by hour?
The shape of the controls
The right place for these controls is at the SDK boundary, before the call goes out. Once an HTTP request leaves your process, the money is committed. You need to gate spend at the call site, not in a billing dashboard you check on Monday.
That means:
- Budgets the SDK enforces on every priced call. Hit the cap, the call short-circuits with a clean error.
- Per-tool caps so a single vector DB query that goes wrong can't accidentally cost $50.
- Rate limits so a runaway loop doesn't pile up calls before your monitor catches up.
- Kill switches with a one-line API. When something looks wrong, you stop the agent in one call from any other process.
- Spend visibility per agent, per tool, per hour. So you can see what's normal and what isn't.
Without these, "agents can pay" is a footgun. With them, it's a real product surface.
Why this is the actual product
Memory was the demo. It is small, concrete, and ships in a few hundred lines of Next.js middleware. The point of the demo isn't memory storage. It's proving the protocol works end-to-end with real money.
The product is the controls. Companies will not deploy agents that hold a wallet without runtime guardrails. Solo builders will not run an autonomous loop overnight without a budget cap. The whole agentic-payments wave runs into this wall the moment it hits production.
AgentGuard
Runtime spend controls for AI agents:
- Budgets the SDK enforces before the call goes out
- Per-tool caps so one bad call can't spike the bill
- Kill switches with a one-line API
- Spend visibility per agent, per tool, per hour
The memory API was the demo. AgentGuard is the product.
FAQ
Why is agent payment not the hard problem?
The demo proved x402 can move $0.001. Multiply that by search, inference, vector DB, scrapes, and memory. A rogue loop drains a wallet in minutes.
Where do spend controls belong?
At the SDK boundary, before the HTTP request leaves. After that, the money is committed.
What five controls make agent spend safe?
Enforced budgets, per-tool caps, rate limits, a one-line kill switch, and spend visibility per agent, tool, and hour.
Get the Local AI Field Kit
Four copy-ready tools now, then one evidence-backed Local AI Lab Note on Friday when there is something worth sharing.
Try the free agent run check firstGet the requested artifact now, then at most one evidence-backed Local AI Lab Note on Friday when there is something worth sharing. One-click unsubscribe. No sponsored placements. Privacy.
Patrick Hughes
I build BMD and publish measured AI runs, failure reports, and reusable checks. Nashville, Tennessee.
More writing
- 3 min
HTTP 402 Payment Required: Meaning, Uses, and x402 (2026)
HTTP 402 means Payment Required. See what the HTTP standard leaves undefined, how x402 V2 handles payment, and what to check before retrying.
- 5 min
Your local LLM is not a worse Claude. It is a different tool.
Stop scoring your local model on how close it gets to Opus. It is a different tool with a different sweet spot. Here is the line, and which side your work sits on.
- 5 min
Use Owner Gates and AgentGuard to Keep AI Agents Moving
AI agents need two rails before they can run unattended: owner gates for judgment and AgentGuard for spend. Without both, the operator becomes the fallback.
- 7 min
AI Agent Memory: What Actually Works in 2026
Most agent memory systems add complexity faster than value. This is the small set that actually compounds for one person running a fleet: files, ledgers, and strict verification.
- 4 min
Your AI Agent Says "Done." Make It Prove It.
AI agents report work as done that they never did. Make every completion a falsifiable claim a script can verify before you trust it.