AI Agents That Pay for Themselves: How the x402 Protocol Works

AI Agents That Pay for Themselves: How the x402 Protocol Works
This research was produced in collaboration with Decipher. For learn more about Nodit’s Web3 infrastructure, please book a meeting here.

Introduction

Until now, payments have always been made by people. You pick something out, pull out your card or open an app, check the amount, and press a button. Every moment of a transaction has involved human judgment and action.

But that assumption is starting to change.

AI agents can now take on the role of the buyer. Directed by a person, they can browse the internet on their own, find the services they need, and complete payments by themselves. When you tell an AI agent "plan a trip for me," it can handle everything — from searching for flights and booking accommodation to paying for it all.

One of the technologies making this possible is the x402 protocol.

What Is x402?

Reference: blog.nodit.io

x402 is an AI autonomous payment protocol developed by Coinbase in 2025 and released as open source. Because it's open source, it doesn't belong to Coinbase — anyone can freely use and build on it. x402 has become the most practical emerging standard for AI agent payment infrastructure, and companies like Stripe, Google, and Cloudflare have already started integrating it into their own services.

How Is It Different from Regular Payments?

Think about how payments normally work. You add something to your cart, click the checkout button, and a bank or card company verifies and moves the money in the background. A person always has to step in — checking the amount, entering a password, and hitting confirm.

x402 changes that structure. Instead of a person, an AI agent becomes the one making the payment. When an AI agent tries to use a service, the server sends a signal saying "this service costs money." The AI agent then handles the payment on its own and retrieves the service — all without anyone stepping in. Requiring human approval for every transaction doesn't fit how AI agents are meant to work. x402 is the protocol built to solve exactly that.

HTTP 402: The Forgotten Code, Revived

When your browser sends a request to a server, the server responds with a number called an HTTP status code. You've probably seen 404 before — it means "the page you're looking for can't be found." And 200 means "everything went through fine."

There's also a code called 402. It means "Payment Required." It was created in the early days of the internet in the 1990s, but there was never a real use for it — so it sat unused for over 30 years.

With the rise of AI agents, x402 has redesigned this 402 code into an automatic payment signal between servers and AI agents. Think of it like walking into a café. You sit down and a staff member comes over and says, "This is a paid seat — please pay first." The same thing happens when an AI agent tries to access a paid service. The agent sends a request saying "give me this data," and the server sends back a 402 code meaning "this costs money, pay first." The agent then processes the payment automatically and re-sends the request. Because it runs on top of existing internet infrastructure (HTTP), it doesn't require building something entirely new — it layers on top of what's already there.

Why Is It Getting Attention Now?

Because AI agents are being used in more and more ways. They've moved well beyond just answering questions — they now search the web, make reservations, and handle real tasks.

The Four Participants in x402 and How It Works

The x402 ecosystem is made up of four participants:

  • Buyer: The AI agent that executes the payment. The transacting party is not a human but an autonomous software agent.
  • Seller: The party that provides services or data to the AI agent. This includes a wide range of digital services like weather data, translation, and search results. The Seller receives requests from the AI agent and returns results through an API (a gateway that lets outside parties access the Seller's service).
  • Blockchain: The channel through which money actually moves.
  • Facilitator: The middleman that connects the other three participants.
    • The Facilitator receives payment requests and verifies that each transaction is legitimate.
    • It manages and coordinates the entire flow until settlement is complete.
    • Technically, x402 transactions can work without a Facilitator. However, using one means Sellers don't have to build blockchain functionality themselves — it lowers the barrier to entry for service providers. More detail on this below.

How an x402 Payment Works, Step by Step

Here's how all four participants interact when a single payment is processed:

  1. A person gives the AI agent (Buyer) a task — for example, "plan a trip for me."
  2. The AI agent finds the paid services it needs (flight search, hotel booking, weather data, etc.) and sends a request to the Seller's server.
  3. The Seller's server returns an HTTP 402 code along with the payment conditions (amount, payment method, wallet address).
  4. The AI agent asks the Facilitator to process the payment. The AI agent pays not with a person's card, but from its own dedicated wallet that has been pre-loaded with USDC.
  5. The Facilitator sends a transaction to the blockchain and confirms it was recorded correctly.
  6. The Facilitator notifies the Seller that the payment is complete.
  7. The Seller provides the service to the AI agent.
  8. The AI agent delivers the results to the person.

Overall, only steps 1 and 8 involve human input while the rest are handled automatically within seconds.

What the Facilitator Actually Does

The Facilitator is the middleware that handles settlement between the AI agent and the blockchain within the x402 payment process.

As mentioned, once the AI agent requests a service, the Seller's server sends a "payment required" signal. The Facilitator then takes care of the following steps in order:

  1. Receives the AI agent's payment request.
  2. Signature Verification: Validates the payment request before anything is sent to the blockchain. Since blockchain transactions are difficult to reverse once submitted, the Facilitator checks three things first:
    • Signature validity: Verifies that the request was signed using the AI agent's private key. If the signature is forged or the request comes from a different wallet, it gets blocked here.
    • Balance check: Confirms the AI agent's dedicated wallet actually holds enough USDC to cover the payment. If not, the transaction isn't sent.
    • Nonce check: A nonce is a unique sequence number attached to each transaction. It prevents the same payment from accidentally being processed twice and stops hackers from copying and replaying old transactions.
  3. Settlement: Sends the transaction to the blockchain. Using the verified signature, it creates an actual on-chain transaction and broadcasts it to the network. Blockchain transactions come with a fee called "gas," and the Facilitator can cover this gas fee on behalf of the AI agent.
  4. Finality: Confirms the transaction has been properly recorded in a block. The more blocks that stack on top of it, the more irreversible the transaction becomes — like concrete setting and hardening over time.
  5. Notifies the Seller that payment is complete.
  6. The Seller provides the service to the AI agent.

Without a facilitator, trust would need to be established directly between the agent and the service provider. The facilitator replaces this requirement with verifiable execution.

Why Does x402 Need Blockchain?

Traditional payment systems were designed with people in mind. Opening a bank account or getting a card requires KYC (Know Your Customer) verification — submitting ID, confirming identity, that kind of thing. But AI agents are software objects with no legal identity, so they can't get past these human-centric barriers.

There's also the issue of scale and frequency. AI agents can potentially process thousands of micro-payments in a single day — think fractions of a cent per data query. Existing card payment systems weren't built for this. They typically carry a fixed fee of 1.5–3.5%, which makes per-API-call micro-payments far more practical on stablecoin rails than on card networks.

Blockchain solves both problems at once:

  • Unlike exchange accounts, blockchain wallets can be created without identity verification — so AI agents can hold wallets too. Wallet creation is purely mathematical and doesn't require approval from any central authority.
  • Even small transactions settle quickly and cheaply on the blockchain, since they're recorded directly on the network without going through traditional financial infrastructure.
  • Money moves wallet-to-wallet, with no bank or card company in the middle.
  • Every transaction recorded on the blockchain is publicly verifiable. This means payment can be proven without a third party — providing a basis for trust even in AI-to-AI transactions.

How Different Blockchains Stack Up in x402

x402 supports multiple blockchains — Base, Solana, Polygon, and others. All three have the technical foundation to handle AI agent micro-payments in terms of fees, speed, and scalability. But actual usage data shows a clear gap.

As of March 2026, Base's cumulative x402 transaction count has surpassed 119 million, with total payment volume exceeding $35 million — firmly establishing it as the core settlement layer for the x402 ecosystem. Solana has processed 38.6 million cumulative transactions worth $7.9 million, while Polygon trails behind. On a cumulative basis, Base leads by a wide margin — but recent weekly data shows Solana processing around 49–51% of all x402 transactions, pulling roughly even with Base.

The gap isn't really about technical differences between the chains. It reflects how Coinbase built its Facilitator on Base and concentrated support there, giving Base an early lead in total volume. Meanwhile, Solana is rapidly gaining share in ongoing activity.

Why Stablecoins Are x402's Payment Method of Choice

A stablecoin is a digital asset whose value is pegged to a fiat currency. For example, 1 USDC is designed to always equal 1 US dollar. That fixed value is maintained by the issuer holding actual dollars in reserve. Stablecoins combine the efficiency of blockchain-based transfers with price stability, making them suitable for frequent, low-value transactions. For this reason, x402 adopts stablecoins as its primary payment medium.


The next section looks at how the rest of the world is responding to this shift.

How the Market Has Responded Since Coinbase Launched x402

The global reaction to x402 isn't just "a new payment protocol showed up." More precisely: the need for a payment language that lets AI agents buy digital resources without human involvement has become very real, and x402 is filling that gap faster than anything else. Following the introduction of x402 by Coinbase in May 2025 as an internet-native payment standard built on HTTP 402, the market has increasingly treated it as a credible payment interface for AI agents rather than an experimental approach.

a16z crypto estimated that stablecoin transfer volume exceeded $12 trillion annually in 2025, and McKinsey noted significant growth in stablecoin-linked card payments that same year. In other words, x402 isn't forcing a new market into existence — it's adding a payment layer that AI agents can call directly on top of a stablecoin ecosystem that's already growing fast.

How Different Industries Are Approaching x402

Each sector sees x402 a little differently.

  • Big Tech and Cloud: These players see x402 as part of AI agent infrastructure. Cloudflare announced the launch of the x402 Foundation alongside Coinbase and confirmed support for x402 payments in its Agents SDK and MCP integrations. Vercel released an x402 MCP, making it possible to attach paid tool payments to MCP servers and AI SDK environments. For these companies, x402 is less a payment feature and more a connection method — how AI agents access paid APIs and tools.
  • Fintech: This group takes a more operational view. Stripe describes x402 in its official docs as machine-to-machine payments: when a server returns HTTP 402, the client pays and re-sends the request, while Stripe handles the deposit address management, on-chain settlement, and PaymentIntent capture. Stripe's machine payment docs also cover operational concerns like micro-payments of 0.01 USDC, refunds, and Stripe balance settlement. For these companies, x402 is a new payment rail — but one that still needs to be wrapped with real-world service operations.
  • Blockchain ecosystem: These players see x402 as an opportunity to expand where stablecoins get used. Stellar describes x402 on its site as enabling APIs and web services to charge per request. In Coinbase's case studies, Exa search and CoinGecko data are shown as services that charge each time a request is made via x402. For these players, x402 is more than a payment method — it's a new way to monetize data, models, and agent services at a much finer granularity than subscription models allow.

Despite all this momentum, the hardest problem remains who is legally responsible when something goes wrong. Even if an AI agent executes a payment, the law ultimately needs to answer: who authorized that payment? How much authority can be delegated to an AI agent? And who is held accountable if something goes wrong? The fact that so many different laws could apply simultaneously to a single AI agent transaction says a lot about how unprepared current legal frameworks are.

The core issue is that x402 defines how a payment is executed — not who is responsible for it. Using a road traffic analogy: x402 establishes "drive on the right side," but leaves open the question of "who pays when there's an accident?" And there's no law yet to fill that gap. Just like the early days of the internet, when companies wrote their own privacy policies before any data protection laws existed, the ecosystem has to operate on self-imposed rules for now. How much USDC can an AI agent's wallet hold? Which payments can an AI agent make, and which should be blocked? What happens when suspicious activity is detected? How are refunds handled? All of these questions are currently left to each party's own judgment.

To sum it up: the world isn't adopting x402 in one unified way. Cloud and developer platforms see it as the payment interface for the AI agent era. Fintech treats it as an extension of commercial payment infrastructure. The blockchain ecosystem views it as a standard that expands where stablecoins can be used. And in the legal and regulatory space, the question of "whose action counts as the payment?" remains very much open. Whether x402 spreads broadly will depend not just on how good the technology is, but on how carefully the accountability structure gets designed.


The next section looks at where Nodit fits in this ecosystem.

Where Nodit Fits in the x402 Ecosystem

As mentioned, even without clear legal standards in place, the x402 ecosystem is already moving. Regardless of where the law lands, verifying that payments completed and confirming transaction status are processes that must exist as long as the ecosystem operates. Nodit provides the blockchain infrastructure that makes this possible for x402 ecosystem participants.

What Blockchain Infrastructure Does Nodit Provide?

Nodit is a Web3 infrastructure service operated by Lambda256. In the x402 ecosystem, the parties that need blockchain infrastructure aren't just Facilitators. AI agent builders, DeFi and trading services, and other ecosystem participants all depend on reliable access to on-chain data. Nodit is the infrastructure layer that supports all of them.

Notably, Nodit was the first domestic infrastructure company to adopt Coinbase's x402 AI agent payment protocol. Here's what it offers:

  • Node API: An API that connects directly to blockchain network nodes. To interact with a blockchain network, you normally need a node. Nodit manages this infrastructure so users can connect without running their own nodes. This can be used for payment verification, transaction confirmation, and other processes needed to handle x402 transactions.
    • Multi-chain, single interface: Supports a wide range of mainnets — including Base, Ethereum, and Solana — through one unified interface.
    • Infrastructure management: Nodit handles everything required to keep nodes running: data syncing, server maintenance, and incident response, minimizing the operational burden on developers.
  • Web3 Data API: Processes raw blockchain data and delivers it in a form that developers can use immediately. Through Nodit x402, AI agents can access real-time on-chain data — like wallet balances needed for x402 transactions — without an API key, using only wallet authentication and USDC payment.
    • Data abstraction and standardization: Data from multiple chains is abstracted and returned in a consistent format, eliminating the need to write separate parsing logic for each chain.
    • Real-time on-chain queries: Key data including wallet balances, transaction histories, and token holdings can be retrieved instantly with no additional processing required.
Note: In February 2026, Nodit became the first blockchain company in Korea to obtain SOC 2 Type II certification, a globally recognized security standard. Full technical specifications are available at the Nodit Developer Portal.

What Is Nodit x402?

Reference: blog.nodit.io

Nodit x402 is a service that lets you use Nodit's APIs conveniently through x402 payments.

Previously, using Nodit's API required signing up and obtaining an API key. Accessing paid APIs meant subscribing to a plan, with a fixed monthly fee charged regardless of how much you actually used. Nodit x402 changes that. You can call Nodit's APIs with just a wallet signature — no sign-up needed — and pay only for what you use.

There are two payment models:

  • Credit: A pre-load model where you top up with USDC and each API call deducts from your balance. Best suited for users who call the API regularly and in high volume. The minimum top-up is $0.01 — compared to $1 for Alchemy and $10 for QuickNode, making the barrier to entry significantly lower.
  • Pay-Per-Use: Each API call is charged directly from your wallet as it happens. Better suited for AI agents that call the API occasionally.

Payments are only available in USDC on Base Mainnet or Solana Mainnet, supporting both Nodit's Web3 Data API and Node API.

Nodit x402 also supports SIWx (Sign-In with X), a multi-chain authentication standard. This goes beyond the typical Ethereum wallet login by allowing users authenticate and call APIs immediately using wallets from different chains, including both Ethereum and Solana, with no separate account creation required. For AI agents, this means they're not locked into a single chain — they can access payments and data across chains with flexibility.

Nodit's Direction as AI Agent Payment Infrastructure

As AI agents increasingly use x402 to access external services autonomously, the reliability of blockchain infrastructure becomes the foundation of trust for the entire ecosystem. Every time an AI agent executes a payment and receives a service, the ability to read on-chain data quickly and accurately has to be a given.

As the x402 ecosystem expands, demand for trustworthy blockchain infrastructure is expected to grow alongside it. Nodit is positioned to meet that demand — with a low entry barrier and a flexible pricing structure.


The next article will cover “How to Choose an On-Chain Data Service for AI Agents” from x402 payments all the way to generating DeFi strategy drafts.

[Source List]

  1. J.P.Morgan, “All micropayments about to have their moment?”, https://www.jpmorgan.com/payments/payments-unbound/magazine/articles/micropayments-moment, Last seen on April 18, 2026.
  2. American Banker, “BankThink Credit card payment rails cannot handle AI-driven transaction volume.” https://www.americanbanker.com/payments/opinion/ai-agents-will-require-a-brand-new-set-of-payments-rails, January 21, 2026.
  3. Coinbase, “Welcome to x402”, https://docs.cdp.coinbase.com/x402/welcome, Artemis, “https://app.artemisanalytics.com/asset/x402?tab=deep_dives. Sherlock, https://sherlock.xyz/post/x402-explained-the-http-402-payment-protocol
  4. Cryptopolitan, “Solana tops Base for the first time in automated stablecoin transactions,” January 14, 2026. https://www.cryptopolitan.com/solana-tops-base-for-the-first-time/Coindesk, “Ethereum Fees Set to Drop for Arbitrum, Polygon, Starknet, Base. But How Much?”, https://www.coindesk.com/tech/2024/03/06/ethereum-fees-set-to-drop-for-arbitrum-polygon-starknet-base-but-how-much.
  5. Solana Floor, “Solana Commands 49% of x402 Market Share as the Race for Micropayment Dominance Intensifies,” https://solanafloor.com/news/solana-commands-49-of-x402-market-share-as-the-race-for-micropayment-dominance-intensifies, CoinLaw, “Gas Fee Markets on Layer 2 Statistics 2026: What to Expect Now”, https://coinlaw.io/gas-fee-markets-on-layer-2-statistics/.
  6. Coinbase, “Introducing x402:a new standard for internet-native payments”, https://www.coinbase.com/developer-platform/discover/launches/x402.
  7. IMF, “Understanding Stablecoins”,https://www.imf.org/-/media/files/publications/dp/2025/english/usea.pdf
  8. Visa, “Visa Launches Stablecoin Settlement in the United States, Marking a Breakthrough for Stablecoin Integration” https://usa.visa.com/about-visa/newsroom/press-releases.releaseId.21951.html
  9. a16z crypto, “Stablecoins: A 1+ billion-user onboarding opportunity” https://a16zcrypto.com/posts/article/stablecoins-data-users-onboarding/
  10. Mckinsey, “Stablecoins in payments: What the raw transaction numbers miss” https://www.mckinsey.com/industries/financial-services/our-insights/stablecoins-in-payments-what-the-raw-transaction-numbers-miss
  11. Cloudflare, “Launching the x402 Foundation with Coinbase, and support for x402 transactions”, https://blog.cloudflare.com/x402/
  12. Vercel, “Introducing x402-mcp: Open protocol payments for MCP tools”, https://vercel.com/blog/introducing-x402-mcp-open-protocol-payments-for-mcp-tools
  13. Stripe, “stripte Docs x402 payments”, https://docs.stripe.com/payments/machine/x402
  14. Stellar, “Stellar Docs x402 on Stellar”, https://developers.stellar.org/docs/build/agentic-payments/x402
  15. Exa, “Exa Docs Pay with x402”, https://exa.ai/docs/reference/x402-guide

[Image Sources]

  1. blog.nodit.iohttps://blog.nodit.io/introducing-nodit-x402-payment-protocol/
  2. blog.nodit.iohttps://blog.nodit.io/introducing-nodit-x402-payment-protocol/

Read more