
AIAgents · 19 min read
How AI Agents Pay with HTTP 402 and x402: My CAIML #45 Talk as a Take-Home Handout
On this page
CAIML #45 at the KölnTurm
On Tuesday, 17 November 2026, the Cologne AI & Machine Learning Meetup (CAIML) met for the 45th time, at Lime Connect in the KölnTurm, Im Mediapark 8, 50670 Köln [1]. Aaqib, Marc and Fabian organised the evening: two talks, then networking.
The first talk was by Ana Moya and Pranit Tandon: “Beyond Large Language Models: A Non-Generative Computational Approach to Text Dynamics and Engagement in German Digital News”. They showed how explainable models without text generation can find what drives engagement in news articles. Not every AI problem needs an LLM. My talk followed at 19:50: “Getting Paid by Agents: When AI Becomes the Customer” [1].

The pocket money moment, live at CAIML #45.
The room was full: 75 registrations, a waiting list, and people standing at the back. Data scientists, machine learning practitioners and developers came from both industry and research. Questions came in through Slido during the talks, and the audience voted the most popular ones to the top. Could agents bargain over prices? How does a buying agent avoid fake sites that charge the same amount? Who pays in the end, and what protects an agent against prompt injection? Over pizza at the networking, the discussion moved to how people use AI agents in their daily work, and I learned a lot from how others do it. Thank you to the organisers for a great evening and a highly recommended meetup.

A full room at Lime Connect in the KölnTurm.
This post is the take-home version of the talk. Each part of the talk gets a short section here, with the links you need to go deeper. I have written about parts of this topic before, in more depth, and I link those posts instead of repeating them.
402: Reserved for Future Use Since 1997
Every HTTP response carries a three-digit status code. Most people know 200 (OK) and 403 (Forbidden). 402 is less familiar. HTTP/1.1 in RFC 2068 from January 1997 lists “402 Payment Required” and says the code is reserved for future use [20]. RFC 9110 from 2022, today’s HTTP semantics standard, still says the same thing in one sentence [21].
Human checkout and approval flows are poorly suited to paying a tenth of a cent for every page. For almost 30 years, the HTTP standards left 402 reserved without defining a standard payment flow. Websites and APIs also receive requests from machines: crawlers, assistants and agents that fetch content on someone’s behalf. With x402, an agent can read the payment requirements in a response header, check them against a budget, pay, and retry the request with the payment proof. My earlier post on the 402 history goes deeper into why earlier attempts at web micropayments stalled [31].
Pocket Money for Agents
In September 2025 I wrote about the pocket money moment for AI agents [30]. Most of us remember our first pocket money. It came with a budget, a time limit (until next week’s money) and someone who trusted you with it. The parents gave the money and set the rules, and the child decided what to spend it on.
Agent payments need the same. Someone funds the wallet and trusts the agent to use it. Someone sets how much may be spent and for how long. The agent decides, inside those limits, whether a purchase is worth it. Keep that picture in mind for the buy side, because AgentCore payments maps onto it closely.
x402, AP2 and MPP
Several industry protocols for agent payments appeared in a short time. In the order they were published:
- Coinbase started x402 in May 2025. It puts payments into plain HTTP using the 402 status code [22]. Version 2, published in December 2025, moved all payment data into HTTP headers [23].
- Google announced AP2, the Agent Payments Protocol, with partners from payments and technology in September 2025. It is an open protocol and can be used as an extension of A2A and MCP [24]. I wrote my pocket money post the week it came out [30].
- Stripe and Tempo published MPP, the Machine Payments Protocol, in March 2026 [25]. It works like x402: a service answers a request with a payment request, the agent authorizes it, and the resource is delivered.
They solve related problems at different layers. The talk is about micropayments, from a fraction of a cent to a few cents per request, and for those it uses x402. Both AWS services in this post speak it [3] [5].
Who Decides What in a Paid Request
The core idea of the talk fits into one payment exchange. An agent asks a site for a resource, and the site can answer with a 402 that carries x402 payment requirements, including the price. The agent then retries the request with payment proof. Two different systems make a decision in that exchange.
The agent decides whether to pay, and for what purpose. Is this article worth the price? Is it within my budget? What will I do with it?
The site decides the price and the license terms. Who is asking, and for which path? And what may the agent do with the content once it has paid?
The diagram below shows both sides together, and the rest of the talk zooms into each part.
The whole picture: the agent pays from the end user’s wallet within a session, the site prices and verifies at the edge, and one challenge-and-retry exchange joins them. I drew it from the AgentCore and AWS WAF documentation. It is not an official AWS reference architecture.
AWS Services Used in This Architecture
Most people at CAIML build with AI. Not all of them build on AWS, so the talk has a short primer. AWS rents computing building blocks through an API, and you pay for what you use. Its AI stack has three layers.
At the bottom is the infrastructure: Amazon SageMaker AI to build, train and host your own models, and AI chips such as AWS Trainium and AWS Inferentia, plus GPUs. At the top are applications that AWS builds and you use, for example Kiro for coding and AWS Quick for business users. In between sit Amazon Bedrock, with models such as Amazon Nova and models from other providers behind one API, and Amazon Bedrock AgentCore to run agents in production.
AgentCore is a set of modules you can use together or on their own: Runtime, Memory, Gateway, Identity, Policy, Observability, Payments and more [4]. It works with any agent framework and any model [4]. Payments is the module the buy side uses.
Buy Side: Amazon Bedrock AgentCore Payments
AgentCore payments has been generally available since August 2026 [5]. It works with Coinbase and Stripe Privy wallets, speaks x402 and MPP, supports the x402 “upto” scheme for usage-based prices, and enforces payment limits at the infrastructure layer [5] [6].
Why does the limit have to sit in the infrastructure? AWS gives the reason in its launch post. Agents are non-deterministic, so they “can misinterpret a response as authorization to spend or repeat a payment because of an unexpected retry” [6]. A prompt injection on a web page can talk an agent out of a limit written in the system prompt. A limit that the service enforces before anything is signed can’t be talked away. It caps the damage, though it doesn’t judge value. Within the budget, the agent still decides what is worth buying, so keep the budget per task small.
The service has four parts, and they line up with the pocket money picture [6] [7]:
- The payment manager is the payment authority in your AWS account. You create it once, as the developer.
- The payment connector links to the wallet provider, Coinbase Developer Platform or Stripe Privy. Its credentials live in AgentCore Identity, so the agent never sees them.
- The payment instrument is the end user’s embedded wallet. After it is created, the end user must fund it and grant signing permission before the agent can pay [8]. The end user funds the wallet and authorizes the agent to sign payments from it.
- The payment session covers a bounded unit of work. In my design, the backend creates one session per task. A session is time-bounded and can have a spending limit. When the session expires or the budget is reached, further payments in that session are denied [9].
The pocket money picture in AgentCore payments: the end user provides the money, your backend sets the budget and the time limit, and the check runs before anything is signed. The 1.00 USD and 60 minutes are example values.
In my own demo setup, the payment chain was the most cumbersome part. Before general availability you created API keys and a wallet secret at the provider, stored them as a credential provider, created a payment manager and connected it with a payment connector. Since GA, Quick Create for Coinbase provisions those credentials from the AgentCore console or CLI without leaving AgentCore [5] [6]. If you prefer code, one SDK call, create_payment_manager_with_connector, creates the manager, the connector and the credential provider together [7]. The wallet and the session are still separate steps.
The price in a 402 is not always the whole cost. Blockchain network fees, often called gas, come on top of the amount. With MPP, when the seller does not sponsor them, the buyer pays them, and AgentCore payments signs only if you explicitly set buyerPaysGasFees to true. The upto scheme needs a one-time on-chain allowance before the first payment, and that transaction costs gas too [10].
Agents already pay per call in production. AWS has published two case studies: Ampersend’s “pay per intelligence” [12], and Incarna paying BlockRun per inference call [13]. I wrote about the second one and the upto scheme in October [34].
Sell Side: AWS WAF AI Traffic Monetization
The site that wants to get paid sits behind Amazon CloudFront, and AWS WAF decides at the edge, before a request reaches the origin [14] [15]. AI traffic monetization takes care of four jobs there:
- AWS WAF Bot Control labels each request with its bot category and name, and checks whether the bot is who it claims to be. A user agent string is only a claim. Agents can prove their identity by signing their requests with Web Bot Auth, which uses HTTP Message Signatures [14] [27].
- Rules with the Monetize action set the price per path and bot class. They match paths, Bot Control labels or other request properties, so a verified research agent can pay a different price for
/articles/than an unverified bot pays for/premium/[16]. - The 402 response carries the payment terms: the price per request in USDC, the accepted networks (Base, Solana), the publisher’s wallet address, a timeout and the payment scheme [3].
- Payouts settle in USDC to your own wallet, or, since November 2026, through a Stripe connected account in local currency, so you never hold a stablecoin yourself [17] [19]. AWS is not a party to the flow of funds [17].
The Developer Guide says AI traffic monetization comes at no additional charge beyond standard AWS WAF pricing [15]. Standard AWS WAF pricing still applies, including Bot Control, which the guide recommends for classifying AI traffic [16]. Settlement runs through Coinbase Developer Platform’s x402 facilitator under Coinbase’s terms, and a Stripe connected account under Stripe’s agreement [17]. Bot classification is probabilistic, so the guide recommends a test mode on Base Sepolia or Solana Devnet with faucet money before you charge real agents [16]. My June post walks through the setup and a pricing matrix in detail [32].
The Paid Request Step by Step
Here is the combined challenge-and-retry flow, in the order things happen. The edge and facilitator steps come from the AWS WAF guide [3], and the ProcessPayment step with its budget and expiry check comes from the AgentCore guide [9] [10]:
One challenge-and-retry exchange, both sides. The origin sees nothing until the payment is verified, and settlement happens only after the origin answered with a 2xx.
This order protects both sides. The origin never sees a request without a valid payment authorization. If the origin fails with a 4xx or 5xx, settlement is skipped and the agent is not charged. Payment authorizations are single-use, so a replayed payment header gets a new 402 [3].
The talk includes a recorded demo of this loop. A research agent with a budget gets a task, runs into a 402 on an article, pays, retries with the payment proof and gets the article back, with the receipt in its ledger. For a premium article it stops and asks first. That pause is a policy of the demo app, and AgentCore payments doesn’t ship it as a feature. You can build the same pause, though: the Strands Agents plugin can run with automatic payment turned off, so a human or your own logic approves each payment before it is made [11]. In the recording the site side runs AWS WAF monetization, the agent signs with a test wallet, and everything runs on Base Sepolia with test money. The AgentCore version of the same loop is the session and ProcessPayment code from the documentation [2] [9].
The same demo was part of the AWS showcase at IBC 2026. The public AWS IBC 2026 Demo Showcase describes it on page 30, with a video of the demo and a one-page architecture [36].
Price and License Terms
An x402-enabled 402 response tells the agent how much to pay, in x402 headers. HTTP 402 by itself defines no price format. The payment requirements say nothing about what the agent may do with the content afterwards, and the AWS WAF Developer Guide makes the same point: monetization “tells agents how much to pay but not what they’re allowed to do with the content” [18].
The edge can enforce access by allowing, pricing or blocking a request. It cannot by itself enforce what happens to the content afterwards, whether the agent uses it to answer a question, trains a model on it, stores it or passes it on. That is the job of license terms, which declare the permitted uses and may carry legal obligations. RSL (Really Simple Licensing) 1.0, published in December 2025, makes those terms machine-readable as an XML license that agents can discover through robots.txt or an HTTP Link header with rel="license" [26]. It only works with agents that honor it, and none of this is legal advice.
It helps to keep apart what AWS WAF documents and what my sample does. In AWS WAF, the 402 carries price, networks and payTo. License terms travel on normal responses, for example as a Link header added by a CloudFront response header policy. The guide notes that the 402 from the Monetize action does not include that header [18]. An agent therefore learns the terms from an unpriced response, such as robots.txt or a normal response that carries the Link header [18] [26].
My sample “terms in the 402” is not an AWS feature. Its 402 carries the price and the license terms together. The agent declares its intended use, reads the license, and refuses to pay when the license prohibits that use, for example AI training [29] [33]. The declared use is a claim, like a user agent string. Bot verification can bind the declaration to a verified bot identity, which improves attribution, but it does not prove that the declared use is truthful or that the bot will comply [14]. In the talk I run it live with curl, so you can see every header. The payment there is simulated and needs no keys and no chain.
What You Can Use Today
The AgentCore payments and AWS WAF monetization features described here are documented as generally available. On the buy side, AgentCore payments has been generally available since August 2026, with x402 (exact and upto) and MPP [5]. The end user’s wallet is an embedded crypto wallet on an EVM network such as Base, or on Solana, so the buy side pays in a stablecoin such as USDC even when the seller takes payouts in local currency [8] [10].
On the sell side, AWS WAF AI traffic monetization with x402 on CloudFront launched in June 2026, with payouts in USDC or, since November 2026, in local currency through Stripe [14] [19]. The site sets a price per request at the edge [16] and publishes its license terms on unpriced responses, such as robots.txt or a Link header on normal responses, because the Monetize 402 doesn’t carry them [18].
Is anyone using x402 yet? agentic.market is a third-party directory of x402 services, and its Payments Race chart sets payments by AI agents against payments by humans [28]. Humans still win by far on that chart. The site also reports live transaction and volume counters, so look at the page for today’s figures. I have not verified how it classifies agent and human payments. To me it looks like early days.
My Takeaway and Where to Start
Managed buy-side and sell-side components now exist, and AWS has published two customer case studies using AgentCore payments [12] [13]. x402 carries the payment negotiation over HTTP. The frame I find most useful is the two decisions. The agent’s builder owns the purpose and the budget, the site owns the price and the terms, and each side can be built and run on its own. Interoperation also requires compatible x402 versions, schemes, networks, assets and settlement support.
If you want to try it, start small. Give one agent task a payment session with a cap and an expiry, and test on Base Sepolia with test USDC. If you sell content or an API, watch your AI traffic first, then price one path in test mode, and publish your license terms. The links below are grouped for both tracks.
The first section tells how the evening went. If you are in the region, come to a future CAIML meetup [1]. My other talks and the video walkthroughs of my posts are on the Talks & Video page [35].
💬 If your agent could pay per request today, what is the first thing you would let it buy, and what would you never let it buy without asking you first?
Sources
All links from the talk, grouped by where you want to start.
Start here
- [1] CAIML, Cologne AI & Machine Learning Meetup · CAIML #45 on 17 Nov 2026 at Lime Connect, KölnTurm; agenda, talks and organisers.
- [2] Get started with AgentCore payments, AgentCore Developer Guide · the buy-side quick start.
- [3] How AI traffic monetization works, AWS WAF Developer Guide · the request lifecycle from 402 to settlement.
Buy side
- [4] What is Amazon Bedrock AgentCore?, AgentCore Developer Guide · the AgentCore modules.
- [5] AgentCore payments is now generally available, AWS What’s New (Aug 2026) · Quick Create for Coinbase, MPP, x402 “upto”.
- [6] Amazon Bedrock AgentCore payments is now generally available, AWS Machine Learning Blog · wallets, payment limits, observability.
- [7] Technical deep dive: AgentCore payments and innovation in agentic commerce, AWS Machine Learning Blog · the one-call setup and the budget check.
- [8] Create a payment instrument, AgentCore Developer Guide · the end user funds the wallet and grants signing.
- [9] Create a payment session, AgentCore Developer Guide · budget and expiry per session.
- [10] Process a payment, AgentCore Developer Guide · x402 schemes, MPP methods and network fee consent.
- [11] Framework integrations, AgentCore Developer Guide · Strands Agents and LangGraph, payment interrupts, auto-payment off.
- [12] Building pay-per-intelligence for AI agents: how Ampersend uses Amazon Bedrock AgentCore payments, AWS Machine Learning Blog · customer example.
- [13] Pay-per-inference for AI agents: how BlockRun and Incarna use Amazon Bedrock AgentCore payments, AWS Machine Learning Blog · customer example.
Sell side
- [14] AWS WAF adds AI traffic monetization capability to help content owners charge AI bots for content access, AWS News Blog · the launch in June 2026.
- [15] AI traffic monetization, AWS WAF Developer Guide · overview and pricing note.
- [16] Getting started with AI traffic monetization, AWS WAF Developer Guide · Bot Control, Monetize rules, test mode.
- [17] Payment networks and settlement, AWS WAF Developer Guide · own wallet or connected account.
- [18] Communicating license terms to AI agents, AWS WAF Developer Guide · RSL, Link header, CloudFront response header policies.
- [19] AWS WAF AI traffic monetization now supports fiat payouts through Stripe, AWS What’s New (Nov 2026) · payouts in local currency.
Protocols and specs
- [20] RFC 2068, HTTP/1.1, section 10.4.3 · 402 Payment Required, reserved for future use (January 1997).
- [21] RFC 9110, HTTP Semantics, section 15.5.3 · still reserved for future use (2022).
- [22] x402 · the open protocol for payments over HTTP.
- [23] Introducing x402 V2 · payment data in headers.
- [24] Agent Payments Protocol (AP2) documentation · open protocol for agent-led payments.
- [25] Introducing the Machine Payments Protocol, Stripe · MPP, co-authored by Stripe and Tempo.
- [26] RSL 1.0 specification · machine-readable license terms.
- [27] RFC 9421, HTTP Message Signatures · the signature format behind Web Bot Auth.
- [28] agentic.market, Payments Race · third-party directory of x402 services; not an AWS product, figures change live.
Samples
- [29] terms-in-the-402, schristoph-blog-samples on GitHub · a 402 that carries price and license terms; runs locally, payment simulated.
My earlier posts
- [30] AI agents are growing up: the pocket money moment · September 2025.
- [31] HTTP 402: The 30-Year Placeholder That AI Agents Finally Activated · the history of 402 and how x402 works.
- [32] Getting Paid by Agents: A Managed Paywall at the Edge · the sell side with AWS WAF in depth.
- [33] Terms in the 402 · the post behind the sample.
- [34] When the Agent Pays per Inference Call · AgentCore payments in production and the
uptoscheme. - [35] Talks & Video · my other talks and video walkthroughs.
- [36] AWS IBC 2026 Demo Showcase · “Monetize AI-crawler traffic with intelligent bot control”, p. 30, with video and architecture (read 17 Nov 2026).
❤ Created with the support of AI (Kiro)