Dev.to AI 🤖 Ai 👁 0 📖 10 min read

The State of x402 AI Agent Payments: Market Data from Running 90 APIs, Entry Strategies, and Building on AWS

This article is the free opening of the book The State of x402 AI Agent Payments. x402 is a payment protocol that uses the HTTP 402 status code to complete a payment inside a request. The client attaches a payment signe

The State of x402 AI Agent Payments: Market Data from Running 90 APIs, Entry Strategies, and Building on AWS

This article is the free opening of the book The State of x402 AI Agent Payments.

x402 is a payment protocol that uses the HTTP 402 status code to complete a payment inside a request. The client attaches a payment signed with its wallet to each request, and the server only has to verify that payment before it responds. This makes pay-per-request billing possible without sign-ups, API keys, or contracts. Payments use stablecoins such as USDC, so prices stay stable in US dollars and APIs are easy to price. Because the whole payment can be completed without a human in the loop, x402 is drawing attention as the payment layer for paid APIs that serve AI agents.

However, almost no data has been published on how often x402 APIs are actually called or how much their providers earn.

This book outlines how x402 works and then publishes real request and revenue data that the author recorded while running 90 APIs. It also analyzes the call counts and prices of the APIs listed on Bazaar to show where the market stands today. Finally, drawing on the author's operating experience, it presents a scalable, low-cost architecture on AWS, which is essential for making money from x402 APIs that earn very little per call.

How x402, the Payment Protocol for AI Agents, Works and Where It Is Spreading

The Problem with Selling Services to AI Agents

AI agents carry out tasks by calling external services, such as search, code execution, and web browsing, as tools. Most paid APIs, however, are designed on the assumption that a human signs up in advance. Using a typical paid API takes the following steps.

  1. Create an account on the service's website
  2. Register a credit card and choose a pricing plan
  3. Issue an API key and add it to the agent's configuration
  4. Pay the bill at the end of the month

A human performs these steps in a web browser. As a result, an agent can only use the APIs that its user has signed up for and configured with an API key in advance. If an agent needs a new API in the middle of a task, it cannot sign up on its own.

Providers face problems too. Even an API that costs a few cents per call needs account management, API key issuance, and billing. Credit card payments also carry a fixed fee per transaction, so processing a payment of a few cents at a time costs more than it earns. For this reason, small APIs are often sold as monthly subscriptions, a pricing model that suits agents that only call an API occasionally poorly.

x402 is a protocol that standardizes the steps from presenting a price to approving the payment, verifying it, and issuing a receipt, all within HTTP requests and responses. The provider verifies the payment before responding, so it never goes unpaid. The client approves a payment only for the amount and recipient it was shown, so it never receives an unexpected bill. These steps let parties without a prior contract trade safely, which solves the problems above.

How x402 Works

x402 was released by Coinbase in May 2025 and is now governed by the x402 Foundation under the Linux Foundation. The status code it is named after, 402 Payment Required, is marked as "reserved for future use" in the HTTP specification (RFC 9110), and no standard usage had been defined for it. x402 defines how to pay with stablecoins using this status code.

A stablecoin is a digital currency on a blockchain designed to keep its value pegged to a fiat currency such as the US dollar. USDC, the stablecoin used most with x402, is a US dollar stablecoin issued by Circle and backed by an equal amount of cash and short-term US Treasuries, so that 1 USDC can be exchanged for 1 dollar. Most x402 payments run on Base, a low-fee blockchain developed by Coinbase.

Almost all x402 payments today use USDC. However, the x402 specification does not depend on a particular currency. A provider can accept other stablecoins by specifying a different currency in the asset field of its payment terms.

How an API Is Bought with x402

With x402, an agent can find an API it needs in the middle of a task and pay for it without human help. For example, suppose an agent that has been asked to arrange a business trip needs to check the status of a flight. It proceeds as follows.

How an AI agent uses an API with x402

How an AI agent uses an API with x402

  1. The agent searches Bazaar, a catalog of APIs that support x402, for an API that returns flight status.
  2. When the agent calls the API it found, the API returns a price and a recipient.
  3. If the price is within the limit set by the agent's user, the agent pays from its own wallet.
  4. The API confirms the payment and returns the flight status, and the agent continues its task.

In this flow, the only things a human does are deposit USDC into the wallet and set a spending limit. The agent does not need to create an account or sign a contract with the API provider. On the provider's side, once an API is published and listed on Bazaar, it can collect payment on the spot from agents it has never seen before.

The infrastructure that gives agents a way to pay is also taking shape.

  • In February 2026, Coinbase released Agentic Wallets, wallets designed for AI agents.
  • In September 2025, Google announced AP2 (Agent Payments Protocol), a protocol for payments made by agents. AP2 supports stablecoins as well as cards and bank transfers, and an extension that uses x402 is available for stablecoin payments.
  • In 2026, AWS launched Amazon Bedrock AgentCore payments, which gives agents the ability to pay with x402. It lets you set a spending limit per session, and agents can find and use APIs listed on Bazaar.

Wallets, protocols, and cloud services that give agents a way to pay within a limit are coming together.

Components

x402 has the three components below. In terms of a trade, the client is the buyer, the resource server is the seller, and the facilitator mediates the payment between them.

Component Role in the trade What it does
Client API user (buyer) Calls the API and signs the payment. AI agents and the SDKs they use fall into this category
Resource server API provider (seller) Provides the paid API. Returns 402 to requests without a payment and responds after confirming the payment
Facilitator Payment intermediary Verifies the payment signature and executes the transfer on the blockchain

The components involved in an x402 payment and their roles

A facilitator is similar to a payment processor in card payments. Unlike a payment processor, however, a facilitator does not hold the funds; it transfers them directly from the client's wallet to the provider's wallet. Anyone can run a facilitator, and providers can choose which one to use. A well-known example is the CDP facilitator operated by Coinbase.

The Payment Flow

A payment is processed in the following order.

How an x402 payment is processed

How an x402 payment is processed

Each step is designed so that both the provider and the client can trade safely.

  1. Presenting the price When the client sends a request without a payment, the resource server returns 402 and announces its payment terms in the PAYMENT-REQUIRED header. The terms include the amount, currency, network, and receiving address. The client can check the price and the recipient before paying.
  2. Approving the payment The client checks the terms and signs an approval of the payment with its wallet. It then resends the same request with the signature in the PAYMENT-SIGNATURE header. The signature covers the amount, the receiving address, and an expiration time, so a third party cannot change the amount or recipient or use the signature after it expires.
  3. Verifying the payment The resource server verifies the signature and the balance with the facilitator's /verify endpoint. The provider can confirm that it will be paid before it starts processing.
  4. Processing and settlement If verification succeeds, the resource server processes the request and, once processing is done, asks the facilitator to transfer the funds with /settle. Because the transfer happens after processing, the server can be implemented so that no transfer happens if processing fails.
  5. Issuing a receipt The resource server returns 200 and the response. The PAYMENT-RESPONSE header contains the result of the transfer, which the client can keep as a record of the payment.

The payment terms returned in step 1 look like this (some fields are omitted).

{
  "x402Version": 2,
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "10000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x...",
      "maxTimeoutSeconds": 60
    }
  ]
}

This example asks for a payment of 0.01 dollars in USDC on Base mainnet (eip155:8453). asset is the currency used for the payment and specifies the address of the program that manages USDC on Base. payTo is the address that receives the payment. USDC uses six decimal places, so an amount of 10000 means 0.01 dollars.

The signature in step 2 is not the transfer itself but an approval of a transfer on these terms. The actual transfer happens in step 4, when the facilitator writes it to the blockchain.

Payment costs are also lower than with credit cards. The facilitator pays the fee for recording the transfer on the blockchain, and the provider pays only the facilitator's fee. For example, Coinbase's CDP facilitator is free for the first 1,000 transactions per month and 0.001 dollars per transaction after that. This makes payments of a few cents viable. And because the facilitator verifies signatures and executes transfers, the resource server does not need its own server to connect to the blockchain.

The x402 libraries support TypeScript, Python, Go, and Java, and work with major web frameworks such as Express, Hono, Next.js, FastAPI, Flask, and Gin. Providers can therefore start charging for an API simply by adding x402 to their existing API server.

Examples of APIs Offered with x402

APIs offered with x402 can be found on Bazaar, an API catalog operated by Coinbase. Agents can retrieve an API's description, price, and input format from Bazaar. If a provider describes the input and output formats in its API configuration, that information is listed on Bazaar when a payment is processed through Coinbase's facilitator.

As of November 21, 2026, Bazaar lists about 40,000 APIs. The main categories and examples of APIs actually listed are shown below.

Category Example APIs (price per call)
Crypto data Ratings and trading data for crypto tokens (0.02 dollars), wallet balances (0.003 dollars)
Web access Fetch a web page and convert it to Markdown (0.001 dollars), web search (0.01 dollars)
People and company data A person's background and contact details (0.28 dollars), filings by US companies (0.003 dollars)
Generative AI LLM chat (0.002 dollars), image generation (0.02 dollars)
Real-world data and actions Weather forecasts (0.002 dollars), airport departures (0.2 dollars), placing a phone call (0.54 dollars)

Examples of APIs offered with x402 and their price per call

Many of these APIs provide things that would take an agent's user real effort to set up individually, such as contracts with telecom carriers or paid databases. With x402, the agent's user can pay only for what they use without signing up for each service.

Prices range widely, from simple data lookups at about 0.001 dollars per call to advanced services such as people search or phone calls at tens of cents per call.

How the x402 Ecosystem Is Growing

x402 transaction volume and participating companies have grown significantly in the year and a half since its release in May 2025. According to Chainalysis, the cumulative number of x402 payments on Base exceeded 138 million by July 2026. In mid-2025, the number was almost zero.

The x402 Foundation

On July 14, 2026, the Linux Foundation announced the operational launch of the x402 Foundation. The x402 Foundation governs x402 as a vendor-neutral open standard, and 40 organizations had joined at the time of the announcement. Its premier members are as follows.

Category Companies and organizations
Payments Adyen, American Express, Fiserv, Mastercard, Stripe, Visa
Cloud and infrastructure Amazon Web Services (AWS), Cloudflare, Google
Crypto Circle, Coinbase, MoonPay, Ripple
Blockchain foundations Monad Foundation, Solana Foundation, Stellar Development Foundation
Commerce Shopify

Premier members of the x402 Foundation (as of the July 14, 2026 announcement)

With card networks, payment companies, and cloud providers on board, x402 is treated as a candidate standard for payments by AI agents, not only within crypto.

Some of these members have started building x402 into their own services. For example, with AI traffic monetization in AWS WAF, you can charge AI bots and agents for content delivered through CloudFront. By setting a price in a WAF rule, you can receive payments with x402 without changing your origin server.

What the Rest of This Book Covers

So far, this book has introduced how x402 works and how its ecosystem is spreading. The number of transactions is growing, and major payment and cloud companies have joined the x402 Foundation.

The author has run 90 APIs on x402 and recorded their revenue, the number of 402 responses, and whether the same users came back. The author has also analyzed the prices and usage of a cumulative total of about 140,000 API listings on Bazaar.

The rest of this book covers the following.

  • Prices, call counts, and revenue by API category, based on Bazaar data
  • Real transaction and revenue data from running 90 APIs
  • Strategies for offering APIs with x402, based on that data
  • The steps to build and launch an API with x402
  • An architecture for running x402 APIs on AWS

We hope this book helps you decide whether to offer APIs with x402 and serves as a guide when you get started.

The full book, with the market data, the revenue data from 90 APIs, the build steps, and the AWS architecture, is available on Leanpub: The State of x402 AI Agent Payments.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.