The Seller Side of x402 Just Got Solved. The Buyer Side Is the Hard Part.
Cloudflare made any resource chargeable over x402. Here's the buyer stack an AI agent needs (identity, wallet, payments, and policy) to clear that paywall safely.

Cloudflare just made a huge part of the internet chargeable by the request. That is the good news. The uncomfortable news, if you are building agents, is that it also just made a huge part of the internet a place your agent will walk into, get quoted a price, and have no idea what to do next. This post is about the second half of that sentence, the buyer's half, and how you actually build for it.
Last week Cloudflare opened the waitlist for its Monetization Gateway: an engine that lets any customer charge for a web page, dataset, API, or MCP tool, with payment settling in stablecoins over x402. AWS launched Amazon Bedrock AgentCore Payments, its x402 offering, in preview in May. The Linux Foundation now stewards x402 through the x402 Foundation, with 40 member organizations behind it. Say it plainly: x402 is plumbing now. The interesting questions have moved on from "will there be a payment rail for agents" to "who is safe to send through it."
A refresher on what Cloudflare actually shipped
Give credit precisely, because the design follows from it. The Monetization Gateway is a seller-side product. It moves metering, payment verification, and settlement off the origin and onto Cloudflare's edge across 330+ cities. A seller writes a rule (charge $0.01 for every GET to /api/premium/*, or intercept a 401 and return a 402 with a price), and Cloudflare handles the x402 handshake close to the buyer. No billing system to stand up, no buyer to onboard. When a request matches, the Gateway verifies payment before it ever reaches the origin.
This is a genuinely important unlock. For thirty years the web ran on trading content for human attention, monetized through ads and subscriptions. Agents break that bargain: they do not watch ads or hold monthly subscriptions; they read a resource once and move on, often thousands of times per human visitor. Usage-based pricing per request is the honest model for that world, and Cloudflare just made it a checkbox for millions of origins.
But a tollbooth only works if the cars can pay. And in an agent-first internet, you also need to trust the cars.
The asymmetry nobody is pricing in
Cloudflare answered the seller's question: how do I get paid when my visitor is a machine? It did not answer (because it is not its job to answer) the buyer's questions. And the buyer is now an autonomous agent with no human in the checkout loop.
When that agent hits a 402 Payment Required, four questions land at once, and none of them are about payment:
- Who is this agent? The seller increasingly wants proof of identity before it serves a resource. Cloudflare itself says many resources "will require both an identity and a payment." An agent that cannot prove who it is gets treated as a bot and blocked.
- What does it pay from? A payment needs a funded wallet with keys someone controls. You cannot hand an autonomous process an unbounded hot wallet and hope.
- Is it allowed to pay this? The seller quoted a price. Nothing about the 402 tells your agent whether this spend, to this payee, is inside the budget its owner set.
- What stops it from paying the wrong thing a thousand times? No human is watching at 2 a.m. when a retry loop hammers the same paid endpoint, or a poisoned document tells the agent a $2,000 feed is "worth it."
The seller's meter is indifferent to all four. It will happily take a payment from a compromised agent draining its owner's wallet. Closing these is the buyer stack, and it is exactly the four powers we build at Abstraxn: identity, wallet, payments, and policy.
The buyer's four questions map to the four powers
| The buyer's question at a 402 | The power that answers it | What it means in practice |
|---|---|---|
| Who is this agent? | Identity (ERC-8004) | A verifiable on-chain identity the seller can check: recognition, not a claim. |
| What does it pay from? | Wallet (ERC-4337 smart account) | An account the agent operates but the owner governs: hands it can't cut off. |
| How does it pay? | Payments (x402) | Autonomous handling of the 402 handshake: it pays its own way. |
| Is it allowed to? | Policy | Spend budgets, allowlists, blocklists, and per-transaction limits enforced before signing, with approval thresholds in active development: the leash. |
The market has crowded into wallets and payments. Identity and policy are the underbuilt half, and they are the half the Cloudflare announcement quietly makes urgent. A seller that can charge every caller means every agent now needs to prove it belongs and prove it is bounded. Let us build an agent that does.
Building the buyer: an agent that clears a paywall safely
There are two parts, and you can start with either. The dashboard gets your application an API key and an MCP endpoint in minutes. The SDK creates the agents and gives you full programmatic control. Together they produce an agent with a wallet, an identity, and a policy the reasoning loop cannot override.
The dashboard path: an API key and an MCP endpoint
To see what agents built on Abstraxn can do before you build one, try the demo at agent.abstraxn.com.
To build your own, start in the Abstraxn dashboard. Create an application and open Agentic Stack: the Overview page gives you an API key and an MCP URL (dashboard setup guide).
That MCP is the whole point. Drop it into any MCP-speaking client (your own agent, Claude, Cursor, a workflow tool), and your agents can discover paid services, clear an x402 paywall, and pay for what they use, anywhere. You are not integrating a payments SDK into your product; you are handing your agent a tool that already knows how to pay. The agents themselves, their ERC-8004 identities, and their budgets and policies are created from your backend with the Agent Kit SDK (the next section), attached server-side and outside the agent's reach.
This is the part worth sitting with. Enabling agentic payments used to imply a payments team, a settlement integration, and a compliance review. Here it is: create an application, copy an MCP config, and make a few SDK calls. The buyer stack became self-serve, the same shape of unlock Cloudflare gave sellers with a rule at the edge, now on the buyer's side.
The SDK path: full programmatic control
When you want to provision agents dynamically, wire this into a backend, or script the policy, the Agent Kit exposes the same primitives in code. One ground rule first, because it is the one that makes the rest safe: the Agent Kit signs on your backend, never in the browser. An access key in client-side code is an agent someone else now controls.
Step 1: Give the agent a wallet and a name
One call provisions an ERC-4337 smart account; one more registers an ERC-8004 identity so a seller like a Cloudflare-gated origin can verify the agent instead of blocking it.
import { AgentKitClient } from "@abstraxn/agent-kit";
const agentKit = new AgentKitClient({
apiKey: process.env.ABSTRAXN_API_KEY!,
});
// Provisions a server wallet + a one-time access key (encrypt it at rest).
const { agent, wallet } = await agentKit.createAgent({
name: "Research Agent",
description: "Buys datasets and API calls within budget",
userIdentity: "user-123",
});
// Registers an ERC-8004 on-chain identity so sellers can verify it.
await agentKit.registerAgentIdentity({
agentId: agent.id,
userIdentity: "user-123",
accessKey: decryptedAccessKey,
organizationId: wallet.organizationId,
evmAddress: wallet.evmAddress,
chainId: 84532, // Base Sepolia, free to try
});Two powers, live. The agent has hands and a face. It can now show up at a paywall as a known, fundable party rather than an anonymous bot.
Step 2: Let it pay the 402 on its own
When the agent requests a gated resource and the origin answers 402 Payment Required with a price and a payment address, the agent should complete the handshake without a human: pay, re-request with proof, receive the resource. That is the whole point of x402, and it is what turns "the agent found the data" into "the agent has the data."
The important design choice is not to let the agent pay whatever it is told. The price in a 402 is asserted by the other side. So payment is gated by policy, which is the next step.
Step 3: Bound what it can spend, where the agent can't reach the rule
The controls sit outside the reasoning loop, so a compromised or looping agent still can't overspend. updateSpendPolicy({ budgetUsd }) sets a cumulative ceiling that Abstraxn's facilitator enforces at payment time, and maxUsdPrice at discover_services keeps pricier endpoints off the agent's menu entirely. Interaction policies add address allowlists, blocklists, and per-transaction limits, checked before every call is signed; approval thresholds and daily ceilings enforced in the ERC-4337 account itself are in active development. The full walkthrough, with code and the gaps between each layer, is in AI Agent Spending Limits: How to Build a Mandate That Can't Be Overspent.
What the seller sets vs. what the buyer must enforce
This is the table worth saving. The Monetization Gateway is powerful on the left column. Everything in the right column is still your job as the party deploying the agent.
| Concern | Cloudflare / seller side | Abstraxn / buyer side |
|---|---|---|
| Price of a resource | Set by the seller's rule at the edge | Bounded by maxUsdPrice at discovery |
| Getting paid / settlement | Verified and settled at the edge over x402 | Paid autonomously by the agent on a 402 |
| Who the caller is | May require verified agent identity | Provided by ERC-8004 identity the agent registers |
| Total the agent may spend | Not the seller's concern | budgetUsd, enforced by the facilitator |
| Paying the wrong payee | Not the seller's concern | Recipient allowlists and blocklists in interaction policies |
| A compromised or looping agent | Will be paid anyway | Denied at signing; nothing leaves the account |
Read across any row and the point lands: the seller's meter is neutral about whether the buyer should be paying at all. Restraint is a separate job, and it lives on the buyer's side.
The Honest Limits
The enforcement layers cover different things, and the spending limits post is honest about where each one stops. One limit is specific to this story: identity is two-sided. Registering an ERC-8004 identity makes your agent verifiable; it does not force every seller to check it. The value compounds as more origins (Cloudflare-gated or otherwise) actually gate on verified agent identity. The direction of travel is clear, but portable identity is worth most in a world that reads it, and we are still early in that world.
Where this goes
Step back and the division of labor is clean. Cloudflare turns the request into a chargeable event. x402 moves the value. ERC-8004 says which agent is acting and for whom. And policy, enforced by the facilitator and Agent Kit's interaction policies today, with account-level rules in active development, is the restraint that makes the whole thing safe to run without a human watching each payment. Authorization proves intent. The rail moves value. Enforcement is what stands between them, and it is the layer a payment gateway alone leaves empty. Checking each payment against what the agent's owner actually authorized is what Know Your Intent (KYI) is for.
Cloudflare said it plainly from its side: soon agents will carry wallets and buy what they need without a person in the loop, and many resources will require both an identity and a payment before they are served. That is precisely the buyer we build. The sellers just got their meter. The next question every team deploying an agent has to answer is simpler and sharper: is your agent's spending enforced in your infrastructure, or is it trusted to the prompt?
Key Takeaways
- Cloudflare solved the seller's side of x402. The Monetization Gateway makes any web page, dataset, API, or MCP tool chargeable per request, settled in stablecoins at the edge. It does not address who the buyer is or whether it should be paying.
- The buyer is now an autonomous agent. At a 402 it needs four things a payment gateway does not provide: identity, a wallet, autonomous payment, and enforced policy.
- Those four are the four powers. Identity (ERC-8004), Wallet (ERC-4337), Payments (x402), Policy. The last two are the underbuilt half the Cloudflare launch makes urgent.
- The buyer stack is self-serve. The Abstraxn dashboard gives your application an API key and an MCP URL you can drop into any client, and the Agent Kit SDK creates agents with a wallet, an on-chain identity, and a budget, no payments team required. To see what agents built on Abstraxn can do first, try the demo at agent.abstraxn.com.
- Build identity first so sellers serve you. Verified agent identity turns your agent from a blocked bot into a known, fundable party.
- Bound spend where the agent can't reach it.
updateSpendPolicy({ budgetUsd })is enforced by the facilitator at payment time; a breach is denied and logged, not paid. - Fence discovery for third-party spend with
maxUsdPrice, and cap irreversible moves with allowlists, blocklists, and per-transaction limits. Approval thresholds in the ERC-4337 account itself are in active development. - On-chain finality makes enforcement non-optional. No chargeback means the limit can't depend on the agent choosing to honor it.
Frequently Asked Questions
What is the Cloudflare Monetization Gateway? A seller-side product that lets any Cloudflare customer charge for a web page, dataset, API, or MCP tool, with payment verified and settled at the edge in stablecoins over the x402 protocol. The seller writes a rule; Cloudflare handles the payment handshake. It does not provide the buyer's wallet, identity, or spending controls.
Does Cloudflare's launch compete with Abstraxn? No, it is complementary. Cloudflare makes resources chargeable (the seller side). Abstraxn gives AI agents the identity, wallet, payment handling, and policy they need to pay for those resources safely (the buyer side). One makes the tollbooth; the other makes a car that can pay and can be trusted.
Why does an AI agent need a verified identity to buy things? Because sellers increasingly gate on it. An agent that cannot prove who it is and who it acts for is treated as an anonymous bot and blocked. An ERC-8004 identity is a portable, on-chain way to prove that without depending on any single network's proprietary registry.
How do I stop an agent from overspending at a paywall? Set a cumulative ceiling with updateSpendPolicy({ budgetUsd }), enforced by Abstraxn's facilitator at payment time, and filter expensive endpoints with maxUsdPrice at discovery. For irreversible moves, add interaction policies (allowlists, blocklists, and per-transaction limits); approval thresholds enforced in the account itself are in active development. The agent's reasoning is never the thing standing between a bad instruction and a settled payment.
Do I need to be a developer or integrate an SDK to enable agentic payments? Not much. In the Abstraxn dashboard you create an application and get an API key and an MCP URL you can drop into any MCP-speaking client (Claude, Cursor, a workflow tool, or your own agent). Creating agents, registering their ERC-8004 identity, and setting budgets and policies happen from your backend with the @abstraxn/agent-kit SDK. To see what agents built on Abstraxn can do first, try the demo at agent.abstraxn.com.
Where does the agent sign its payments? On your backend, with the agent's encrypted access key, never in the browser. Keeping the key out of the agent's runtime means a compromised or prompt-injected agent process still cannot mint arbitrary payments.
Do I have to be a Cloudflare customer to use this buyer stack? No. The Abstraxn buyer stack works against any x402-enabled seller: Cloudflare-gated origins, AWS's implementation, or any origin that speaks the protocol. x402 is an open standard.
About the Author
Pankaj Kumar
Software Engineer
Pankaj Kumar is a software engineer at Abstraxn, where he works on the infrastructure that lets AI agents authenticate, pay, and transact without human intervention. Before Abstraxn, he spent five years building payment systems and developer tooling. He writes about account abstraction, on-chain payments, and what it actually takes to make autonomous systems work reliably.
More from Pankaj Kumar