Monetizing AI agent traffic: Write your first Monetization Gateway rule
Presented by: Rohin Lohe, Will Papper
Originally aired on October 24 @ 12:00 AM - 12:30 AM EDT
The majority of Internet traffic is now driven by AI agents, which means that businesses must learn how to charge AI agents for their consumption. In this session, developers and business strategists will learn how to set up their first monetization rule in the Cloudflare Monetization Gateway, experiment with pricing strategies, and track what agents actually pay for.
English
Transcript (Beta)
Hello, everyone. Thanks for being here. I'm Rohin, and this is Will, and we are members of our product team helping Dream about new business models for the Internet.
So thanks for joining us today. I'm going to talk to you about how monetization works on the Internet and about some of the business models we're thinking about today.
I'm curious here, how many of you think about agents as a first-class buyer of the product that you're building?
Oh, that's a lot. Okay. How many of you have done something about it?
Okay. That's excellent. I think 100% of the hands should be up this time next year.
And I'm excited about sharing how you can do that and where it's breaking today.
So the Internet monetization models of today were really designed for humans, right?
And they show up in three ways. First is ads.
And ads are designed for humans with attention, with eyeballs. Agents don't have eyeballs or hands.
So subscriptions are the second model. And subscriptions are really designed for people who are coming back, buying repeatedly from your service.
And subscriptions work well when the user is using your product a decent amount, maybe not too much or too little, right?
And so when you don't necessarily have that loyalty, subscriptions also start to break.
And free tiers, right? Free tiers are really designed around the laziness of humans.
Humans aren't going to go and create hundreds of thousands of accounts and abuse your free tier.
But agents, well, they're certainly more persistent and resourceful than all of us in this room.
And when we couple that with what we heard Matthew Prince say in the keynote this morning, bot traffic isn't slowing down.
And really over the next five years, we might see it a thousand X higher.
And this shows up in your business, right? The cost to serve this traffic is real.
Each request requires compute, requires bandwidth, requires storage, and there's no one to pay for it.
Your ads were paying for it before, your subscriptions were paying for it before, but now you're footing the bill.
And so what if we told you there's a way to do more than just allowing or blocking access?
What if you relied on something that the Internet standards had announced more than 20 years ago?
It's called 402, it's a payment required, and it's effectively a way to announce to any visitor that, hey, you must pay to get access.
And so here is something that Cloudflare is issuing today on behalf of a customer, this customer's API to PDF.com, and they put up a 402 payment required when someone visited without an API key.
And I'm going to show you how you can do it too.
It's called the monetization gateway, it's a paywall for agents. And so let's start with, let's try to configure your first rule, and I'm going to hop into a little bit of a demo.
This is, we're going to save some time for questions at the end, hopefully, but Will and I are going to do a demo each and show you what this is all about.
So this is a site, a personal site, and I have a little form here.
It says contact. You can write me a nice email, but really what I've been seeing is agents have been liking me more than humans have, and I've been getting a lot of emails.
And unfortunately, my credit card is on file with the Cloudflare email service, and so I'm having to pay for that, and it's getting a little bit too expensive.
So I thought, what if I use the monetization gateway? So let me hop over.
This is the monetized tab within your Cloudflare dashboard. It's at the account level, and you can see monetization gateway here.
And what I'm going to show you is, here's my domain, rohan.dev, and I'm going to set up a rule.
All of you can do this.
So this rule says a few things.
It says, what domain do you want to charge for? What is your wallet address?
And so today, you have to bring a wallet that can hold stable coins.
We'll soon be providing you a native primitive that Will's going to talk about more, a native primitive to be able to receive stable coins and more, but I'll add a wallet address.
And then let me show you how the rules and how you can build the rules.
So if I go back to that page, the URL here for the contact page is rohan.dev slash contact me.
So I can set up a paywall just for that path. You can decide who you want to charge.
You can charge everyone who visits the site, or you can say, I only want to charge people who Cloudflare knows is 100% a bot.
Let's say I want to charge everyone, even humans.
How is your asset priced? So this is really, this depends on how you think about your cost of goods sold.
If you have something that has, if your product has variable costs, you probably want to do variable pricing.
If your product has fixed costs, you want to charge fixed amounts.
For my service, there's a fixed price. Every single time I receive an email, there's an equivalent cost.
And so what I'm going to do is I'm going to make this a really, really small amount.
I'm going to make it 1,000th of a dollar. Now, this isn't too expensive.
So I think people will still send me emails, but hopefully it's just enough that the people who are a little too incessant or want to get in touch with me, see a little bit of a roadblock.
Now, there are advanced conditions.
You can say what request methods you want to control. You can set up rule wallet addresses per rule.
You can even start controlling it by country. So maybe if I want to roll this out carefully, I might only restrict this to specific countries where I'm seeing the most traffic, right?
In this case, I actually want to roll this out.
I'm pretty confident. I'm going to roll this out everywhere.
So I'm going to say create monetization rules. So it'll confirmation model.
Let's create it. Okay. And we should be good. Let's go back here. And I'm going to go to my site again.
And I'm going to try to contact. And I'm getting a payment required.
And so now, as a human, this might be a little hard to navigate at first, right?
There's not really a way for me to go pay. But to an agent, this makes a lot of sense.
There are instructions. The agent actually receives this response, and they can follow the instructions to pay.
And if they pay, they can email me. They can submit that form.
So I'm going to show you what actually happens under the hood.
If we can go back to the slides. We power all of this with an open protocol called X402.
And X402 is something that our friends at Coinbase announced.
And we really brought it into the open ecosystem. There's a foundation that backs it.
We contribute to it all the time. And we're really proud of what we're building with peers at Visa, MasterCard, Shopify, Google.
You name it, they're probably in the foundation. And as soon as the slide comes up, I'll show you.
So I want to show you how the X402 protocol works.
This is a buyer.
And the buyer is coming to a site. Let's say we'll go back to my rohan.dev site.
The monetization gateway sits in front of my site. Again, it's a paywall for agents.
On your behalf, on the website's behalf, we return a 402 payment required.
We say, hey, if you want access, you got to pay. And the buyer now has the option.
Is this service valuable enough for them? If it is, they can sign a payment payload.
They can say, yes, I'm good for the money. Please, I want to reaccess your site.
So they try again to give this proof of payment in the payment signature header.
And then Cloudflare does all the heavy lifting for you. We do the payment verification.
We ensure that the response is generated neatly on your side. And then finally, before returning the response, we ensure that the payment actually settles.
Now, Cloudflare does not sit in the flow of funds here. The money moves directly from the buyer to the seller, and it moves at Internet speed.
You're not going to wait for three days for it to settle.
It happens immediately. And what's amazing is that you can make this work for any scale of payment.
Proprietary data set that costs $3,000, charge it.
Like, my silly contact me form, a thousandth of a dollar, charge it, right?
Like, your imagination is your opportunity.
Once this transaction finalizes, we return the response, the money's in your wallet, everyone's happy.
And really, as Matthew Quinn said this morning, this is a way for us to make the Internet more equitable, for more services to find new buyers, and for us to find new ways to make the Internet sustainable in this, what I would call a moment of crisis.
And so now, Will's going to show you the Stock Choke Generator, which is a wonderful demo.
So we've talked about the seller side.
Rohan showed what it's like to become a seller of goods via X.402. But you might be wondering, what is it like to be a buyer of goods via X.402?
And if you have never made an Identic Commerce transaction before, if you try this out, you will have done so for the first time.
So by the end of this session, every single person in the room will have tried out Agenda Commerce, using stable coins, using X.402.
Right now, what I built was this little Stock Choke Generator. Some of the jokes are funny, some of the jokes are not very funny.
AI humor sometimes needs to be worked on.
But the thing that it will do under the hood is it will call a bunch of other services for us.
So let's generate a joke. Let's try NVIDIA. So everyone here, if you'd like, you can try this out yourself too.
It's just jokes .papri.me.
Feel free to try this out, follow along. I'm subsidizing it for you. So yeah, feel free.
All you have to do is, by default, it'll tell you how to pay. It'll tell you this joke costs $0.10.
And you can copy the instructions for your agent.
We also have this agent.md file that is very easy for agents to read, that tells you how to do the payment flow.
But not all of us have a stable coin wallet set up right at this moment.
That's something that Cloudflare is working on to make this flow much, much easier.
But right now, to make it easy for everyone to get started trying out X.402, we have this little coupon code.
So if you type in connect X.402, it will run anyway.
Cool. If you type in connect X.402, it will generate all of these jokes with just $0 .10 paid by me instead of $0.10 paid by you.
And under the hood, what we're doing is we're actually accessing all of the APIs that the service depends on via X.402 as well.
So just now, we've paid $0.10 of a penny to StockTwits.
And this is already transferred to them, and it's so that we can get the stock price.
We can see that people are very bullish on NVIDIA based on the StockTwits data.
We also then ran a new search via Ceramic. This is also an X .402-enabled site, also running like StockTwits via Cloudflare's monetization gateway.
And this Ceramic service, you can see, you can check out basically how it's pulling all of the news for us under the hood.
And then it runs through Cloudflare's AI gateway, also paid for via X.402.
And in this whole process, the end state is that you don't need an API key to try out any of these services.
Literally, you tell your agent, go find news for me, it will find news for There's no signup flow that you have to bother with.
I literally did not need to even go to the StockTwits or Ceramic websites necessarily to get this working.
I just told my agent to figure it out.
I gave it the Cloudflare monetization gateway documentation, and it figured it out.
So you can see that all of this becomes, the end state is a very easy buyer experience.
The hard part about this, there's a couple of things that are hard.
One is the fact that you need to get stablecoins. Some people have stablecoins, some people don't.
Under the hood, the way I solved this was just by giving stablecoins to people.
So I loaded this wallet up with $10. My agent cannot spend more than $10.
It's currently spent $2. And that allows people who don't have stablecoins to just operate on their behalf.
But the thing that's really nice about this is that as we make it easier to acquire stablecoins, more and more agents will be able to access this flow.
Our job at Cloudflare is we want to give you a massive pool of buyers and a massive pool of sellers.
That is our number one priority to make this ecosystem happen using open protocols and open standards.
And from there, this allows you to just essentially very, very easily try out any API.
Your agent can try out hundreds. Now, the second thing that's hard is that if your agent is trying out hundreds of APIs, it's making hundreds of transactions.
And this, I think, is the future that people aren't ready for.
There are people who have been thinking about this for a while, but the future that people aren't ready for is one where every single website under the hood is paying all of its service writers in real time.
You go to a web page and it's making three, four, five payments under the hood.
We will see payment volumes for x402 for agentic payments multiply 100x, 1000x.
I think because as soon as this becomes mainstream, you're not just paying for these jokes.
Some people have paid for these jokes, like these are paid for.
But then under the hood, all the services are paid for as well.
So we should expect massive, massive increases in overall transaction volume, not just because more agents are buying and selling, but because all of these backends adopt it too.
And it creates this significant, significant flow under the hood.
So happy to chat more about anything related to this. The two main open problems, if you're wondering what is coming next, one that we alluded to is discovery.
How does your agent find the stock to its API, the ceramic API, my joke API, if you're looking for jokes.
An agent can try out hundreds of APIs, but it needs to know they exist.
That's the problem one that we're solving.
Problem two is identity for agents. So right now, these buyers, I can see that someone who paid was 0xe748.
That doesn't tell me a whole lot about my customer.
I don't know anything about their customer profile. We have Cloudflare pay handles that we're working on to allow agents to identify themselves.
And then that way you have some better sense of who your customer is, if they choose to disclose it.
If they choose not to, you have a random string of letters and numbers.
But that is up to them. And hopefully they can get better service and you can serve them better with an identity primitive.
So we're looking for you to tell us what you're building.
We want all of you to be experimenting with the monetization gateway.
We want you to tell us all the new and exciting use cases.
If we go back to the StockTwits example, StockTwits has enterprise data that they sell to large financial institutions on sentiment analysis for stock trading.
It helps these large institutions trade on this information.
For the first time, they're actually making these sentiments available to the public on a pay-per-use basis.
And they're saying, if you come and access our site without an API key, we will allow you to pay for it with a 402.
That's a new business model.
It took them some thought, they found something really exciting, and now they're starting to see real transactions flow through.
So really, tell us what you're building, get in the arena, try things, and we look forward to hearing from you.
