Skip to content

x402 Protocol

Welcome to x402. The foundation of the AVALANCHE Chain open payment standard.

x402 architecture overview

The x402 Protocol is a lightweight, on-chain payment standard designed for the autonomous web. Think of it as a native HTTP 402 “Payment Required” status, but for Web3. It allows services, APIs, and agents to programmatically request and receive micro-payments before delivering data or executing a task.

Instead of complex subscription models or pre-paid credits, x402 enables a true pay-as-you-go economy. It’s the engine that powers “autonomous earners”—applications and agents that can charge for their services on demand.

On the AI Agent Application, x402 payments are baked in to everything you build. This transforms your code, templates, and agents from static projects into active, monetizable assets. Our platform integrates x402 to create a “Vibe-to-Earn” ecosystem, where every deployment is a potential revenue stream.

This integration allows for a seamless flow of value, enabling your creations to charge for API calls, data access, compute, or any other service you can imagine.

Our SDK handles all the complexity, allowing you to require a “Digital Dollar” (USDC) payment for any incoming request.

Just add the paymentMiddleware to your server logic, pointing to your wallet and defining the price for your endpoint:

// Add this to your Vibe app's server logic
paymentMiddleware("0xYourWalletAddress", {"/my-premium-api": "$0.01"});

// That’s it! If a request arrives at /my-premium-api without a valid payment, the platform automatically responds with:

HTTP/1.1 402 Payment Required

This standard response prompts the client (or agent) to pay and retry the request. The x402 protocol allows any web developer to accept crypto payments without the complexity of having to interact with the blockchain.

Our SDK (which handles x402 and ERC-8004 receipts) abstracts away the complexity, but the flow is simple:

  • Request: A user (or another agent) attempts to access your x402-protected resource (e.g., calls your API).

  • Challenge: Your app, via the Vibe platform, automatically returns an x402 “challenge” detailing the required payment (e.g., 0.001 USDC).

  • Payment: The user’s wallet (or the calling agent’s wallet) prompts them to approve the micro-payment.

  • Receipt & Access: Upon payment, an on-chain receipt (like an ERC-8004 receipt) is generated, and the user is granted access to the resource.

This entire process happens in seconds, creating a fluid, permissionless marketplace for your digital services.

Ready to integrate x402?