Skip to main content
x402 is the internet-native payment protocol created by Coinbase. It utilizes the previously dormant HTTP 402 Payment Required to a payment layer directly to web services like API endpoints and MCP servers. With a major surge in the growth of AI tools and services, especially with so many of them defaulting to grounding themselves on live web information, the ability to access resources to extend and enhance large langauge models and the agentic consumers like AI Agents and propmting tools has become crticial. However, subscriptions and API keys don’t always lend themselves well to the needs of autonomous agents or prompting tools. x402 aims to be the payment protocol for AI and web services while also ushering in a new era of payments that default to the use of stablecoins and digital assets for faster and cheaper payments.

How it works

x402 is actually pretty simple. A user, client, website, API, server, AI agent, or any other device that has the ability to make a reques to another protocol makes a request. The request is recieved by the server and if payment protected, responds with the HTTP 402 Payment Required status code and a JSON object with the accepted payment options. If the client wants to proceed with accessing the resource, they must then provide the payment information required via the X-Payment header. Today, the vast majority of x402 payments are being done with stablecoins using a gasless meta transaction system known as Transfer with Authorization, officially created as EIP-3009. This system allows the client to sign an authorization which is sent back to the server in the header. The header can then be verified and executed by the server (or facilitator). Upon completion of the execution, the server then responds back to the client with the requested resource.

Key Benefits

Machine Friendly

x402 has the opportunity to disrupt a signifcant portion of the payment industry by design just due to existing designs being ripe for disruption like subscriptions and API keys. However, x402 at the end of the day is built for a world where automation is becoming the norm. This standard is easily integrated into autonomous agents and AI-prompting tools like ChatGPT, Claude, and more. This machine-first design allows for a more seamless convergence between AI and crypto and really brings the amazing technology that is blockchain to the customer who can most easily use it: AI Agents.

Speed

Payments are moving at the speed of blockchain. While not all blockchains are made equal, the speed of execution and confirmation for most of the major blockchain networks is in the span of seconds with finality in the range of dozen of minutes compared to the hours or days it can still take for traditional payment systems. Chains like Base and Solana are incredibly fast with differing degress of finality available. So far these two chains have dominated the x402 usage. Additional blockchain networks like SKALE are joining the fray with their own unique value propositions with zero gas fees and instant finality.

Micropayments

x402 by default has no cost. This is a major differentiator compared to traditional payment systems which often charge flat and percentage based fees for every single transaction that can often stretch into the hundreds of basis points range even on small payments. The primary cost associated with x402 is the gas fee for the settlement of the payment. This is generally being handled by the facilitators on a given network who are a special service in the x402 flow that enables merchants/sellers to remain fully gasless and unburdended by implementing blockchain logic into their services.
Gas fees on Base for settlement are averaging around $0.003 USD in ETH and $0.002006 USD in SOL on Solana.

Stablecoins

The majority of x402 payments are being done in USDC today. This is a major differentiator compared to traditional payment systems which often charge fees in local fiat currency. The v2 spec brings a more flexible approach which can enable more flexible use of existing payment options like credit cards, bank transfers, and more.