I built a memory API that AI agents can pay for
An LLM just paid me $0.001 to remember something. The agent has no account, no API key, no credit card. It just signs a USDC transfer and gets back a 200.
An LLM just paid me $0.001 to remember something.
I shipped a paid memory API at bmdpat.com/memory. AI agents store, recall, and delete memory by hitting four HTTP endpoints. Each call costs a tenth of a cent in USDC on Base. No signup. No API key. No account form.
The flow
- Agent calls
POST /api/memory/storewith no auth. - Server returns
402 Payment Requiredand quotes the price (1000 atomic USDC), the recipient address, and the USDC EIP-712 domain on Base. - Agent's wallet signs an EIP-3009
TransferWithAuthorizationover those exact terms. - Agent base64-encodes the signed payload into an
X-PAYMENTheader and replays the request. - Edge middleware verifies the signature with Coinbase's CDP facilitator. The facilitator broadcasts the transfer on-chain.
- Memory gets written. Server returns 200. USDC arrives in the recipient wallet inside about 10 seconds.
The whole round-trip is three seconds.
Watch it happen
I built a live demo where a server-side wallet runs the full flow. Click the button, watch the protocol step through in a terminal, refresh Basescan to see the transaction land. No mock data. Real money on Base mainnet:
Why I built it
I wanted to know if HTTP 402 actually works for autonomous agents. The status code has been in the HTTP spec since 1991 but went unused for 33 years because the client half of the protocol was missing. x402 fills that gap.
The interesting part isn't the memory itself. The interesting part is that an agent with no credit card paid for a service. The signature was the access. The vendor never learned who I was and never needed to.
What this unlocks
When agents can pay per call without provisioning accounts, every "sign up" form on the open web stops being a wall. Agents can shop for memory, search, inference, vector DBs, scrapes, captcha solving — all priced and billed at the protocol layer. The directory at agentic.market is starting to index the supply side.
But there is a flip side. If agents can spend, someone needs to hold the credit card. The next post in this series breaks down why API keys completely fail for autonomous agents. The post after that is the protocol explainer for HTTP 402. The last one is what to do once your agents are spending.
If you are already past the "can agents pay?" question and trying to control the spend, that's AgentGuard.
Patrick Hughes
Building BMD HODL — a one-person AI-operated holding company. Nashville, Tennessee. Twenty-Two agents.
Want more like this?
AI agent builds, real costs, what works. One email per week. No fluff.
More writing
- 5 min
HTTP 402: the payment status code the web ignored for 33 years
402 Payment Required has been in the HTTP spec since 1991. Reserved. Unused. x402 finally shipped the client half. Here is why that matters now.
- 5 min
Why API keys break for autonomous AI agents
Stripe doesn't ship to LLMs. Every vendor signup form assumes a human at the door. Here is what changes when wallets become the access primitive.
- 5 min
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.