x402 Meaning:
x402 is an open payment protocol that uses the HTTP 402 'Payment Required' status code to let servers charge clients in stablecoins on a per-request basis, with no accounts or API keys needed.
What Is x402
402 Payment Required status code. Instead of relying on subscriptions, API keys, or credit-card billing, an x402-enabled server responds to a request with a 402 status and a small JSON payload describing how much the caller must pay, in which stablecoin, and on which chain. The client signs an on-chain payment, retries the request with proof of payment in the headers, and the server returns the resource.Key Takeaways
x402 is an open protocol that uses the HTTP 402 status code to settle payments in stablecoins on a per-request basis.
It was introduced by Coinbase as a payments primitive for AI agents, APIs, and pay-per-use content.
USDC on Base is the default settlement asset, but the standard is chain- and asset-agnostic.
Clients pay using an EIP-3009 'transferWithAuthorization' signature, removing the need for accounts or API keys.
x402 pairs naturally with agent-readable infrastructure like deep-linking APIs (e.g. riftl.ink), giving agents both routing and a way to pay.
x402 enables true micropayments because settlement happens on low-fee L2s rather than card rails.
Why HTTP 402 Was Revived
402 Payment Required status code has existed in the HTTP specification since 1991, but it sat unused for more than three decades because the web lacked a fast, low-cost, programmable money layer. The rise of stablecoins like USDC and low-fee Layer 2s such as Base finally made it practical to settle a few cents — or even fractions of a cent — directly inside an HTTP request/response cycle.How x402 Works
- Initial request: The client requests a protected resource (
GET /articleorPOST /agent/search). - 402 response: The server replies with HTTP
402 Payment Requiredand a JSON body listing the price, the accepted token, the chain, and the recipient address. - Signed payment: The client constructs an EIP-3009
transferWithAuthorizationsignature for the required amount of stablecoin. - Retry with proof: The client repeats the request and attaches the signed payment in an
X-PAYMENTheader. - Settlement and delivery: A facilitator (or the server itself) submits the signature on-chain. Once confirmed, the server returns the requested resource.
x402 Use Cases
- AI agent payments: Autonomous agents can pay for search results, scraped data, or LLM inference without a human ever provisioning an API key. Combined with agent-readable deep links from services like riftl.ink, an agent can resolve where to go and what to pay in a single round trip.
- API monetization: Developers can charge per call instead of forcing customers into monthly subscriptions and rate limits.
- Pay-per-article content: Publishers can charge a few cents per article or video segment instead of putting everything behind a monthly subscription.
- Micropayments for data: Sensor networks, prediction markets, and on-chain oracles can sell granular data points without batching.
- Programmable tipping: Webhooks and bots can compensate creators or contributors with no platform middleman.
x402 vs. Traditional Payment APIs
- No accounts: There is nothing to sign up for. A wallet signature replaces username/password and KYC for most flows.
- Sub-cent fees: Settling USDC on an L2 costs orders of magnitude less than card interchange, making true micropayments viable.
- Global by default: Anyone with a stablecoin balance can pay, regardless of geography or banking access.
- Machine-friendly: Agents and scripts can transact without human intervention, which is essential for the DeFi and autonomous-agent ecosystems.
Stablecoins, Gas, and Settlement
x402 and the Agentic Web
- Payments: x402 gives an agent a standard way to pay for a resource it has decided to fetch.
- Routing and discovery: Deep-linking and attribution APIs such as riftl.ink — which describes itself as "deep links for humans and agents" with the tagline one URL, two audiences — let a single URL redirect a human user to the correct app screen on iOS, Android, or web, while simultaneously exposing structured, machine-readable data that an agent can act on.
- Identity and intent: Wallet signatures, capability tokens, and similar primitives describe who the agent is and what it is allowed to do.
Risks and Considerations
- Wallet security: Compromised signing keys lead to direct loss of funds.
- Stablecoin risk: A depeg event could change the real value of payments mid-flow.
- Reorg and finality: Servers must decide how many confirmations to require before delivering a resource.
- Spec maturity: x402 is new, and details around dispute resolution, refunds, and metering are still evolving.