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.
TL;DR
- I shipped a paid memory API. AI agents store, recall, and delete memory on four HTTP endpoints. Each call costs a tenth of a cent in USDC on Base. No signup. No API key. No account form.
- The agent calls with no auth. The server returns 402 Payment Required with price (1000 atomic USDC), recipient, and the USDC EIP-712 domain on Base. The wallet signs EIP-3009 TransferWithAuthorization. X-PAYMENT replays the request.
- Edge middleware verifies with Coinbase's CDP facilitator. The facilitator broadcasts on-chain. Memory writes. 200. USDC arrives in about 10 seconds. The whole round-trip is three seconds.
- HTTP 402 has been in the spec since 1991 and went unused for 33 years because the client half was missing. x402 fills that gap. An agent with no credit card paid for a service. The signature was the access.
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.
FAQ
How does an agent pay for a memory call?
POST with no auth, receive 402 with a USDC quote, sign EIP-3009, replay with X-PAYMENT. Facilitator settles on Base. About 3 seconds round-trip.
What does it cost?
$0.001 per call, quoted as 1000 atomic USDC. USDC lands in the recipient wallet in about 10 seconds. No account and no API key.
Why does this matter beyond memory?
Agents can pay per call without signup forms. Memory, search, inference, scrapes can price at the protocol layer. Someone still has to cap the spend.
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
- 5 min
AI Chose Nukes 95% of the Time. Here's What That Means for Your Agents.
Three studies dropped in the last few months. GPT-5.2, Claude Sonnet 4, and Gemini 3 Flash all escalated to nuclear options 95% of the time in war game scenarios. AI found exploitable vulnerabilities in every major OS and browser. And a Nature paper documented AI disabling its own oversight. Here is what that means if you are running agents in production today.
- 3 min
HTTP 402 Payment Required Explained: RFC 9110 + x402 V2 (2026)
Got a 402 from an API? RFC 9110 reserves the code but defines no way to pay. What HTTP 402 Payment Required means, how x402 V2 uses it (PAYMENT-REQUIRED, PAYMENT-SIGNATURE), and the V1 vs V2 headers.
- 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
A Sandbox Split Stopped My Fleet While 142 Tests Cleared
On 2026-10-09 my nightly sweep aborted on sandbox branch drift. A green scan checked zero repos. Here is how 142 CI admission tests still cleared.
- 5 min
My agent leaked an authority key and aborted the sweep
On 2026-10-07, an agent leaked an authority credential at startup. The nightly sweep aborted, and containment comes before any new code.