Overview
x402 is an open standard for internet native payments.
A server returns HTTP 402 Payment Required response with a
machine-readable description of what it costs; a client attaches a signed
payment message and retries; a facilitator settles the payment on chain and
the server returns a receipt along with the purchased content to the client.
On Mezo, the default settlement asset is MUSD. A seller names a price, such as $0.01,
the x402 SDK resolves that to an MUSD amount at runtime
(18 decimals, permit2 + EIP-2612), and the buyer’s wallet signs a
message to authorize the transfer within a timebox.
The payment flow at a glance
Section titled “The payment flow at a glance”-
Clientmakes an HTTP request to aserver. -
Serverresponds with a402 Payment Requiredstatus and aPaymentRequiredb64 object return as aPAYMENT-REQUIREDHTTP header. -
Clientselects one of thePaymentRequirementsreturned by the server response and creates aPaymentPayloadbased on thescheme&networkof thePaymentRequirementsthey have selected. -
Clientretries the HTTP request, now including thePAYMENT-SIGNATUREHTTP header containing thePaymentPayloadto the server. -
Serververifies thePaymentPayloadis valid either via local verification or by POSTing thePaymentPayloadandPaymentRequirementsto the/verifyendpoint of afacilitator. -
Facilitatorperforms verification of the object based on theschemeandnetworkof thePaymentPayloadand returns aVerification Response. -
If the
Verification Responseis valid, the server performs the work to fulfill the request. If theVerification Responseis invalid, the resource server returns a402 Payment Requiredstatus and aPayment Required ResponseJSON object in the response body. -
Servereither settles the payment by interacting with a blockchain directly, or by POSTing thePayment PayloadandPayment PaymentRequirementsto the/settleendpoint of afacilitator. -
Facilitatorsubmits the payment to the blockchain based on theschemeandnetworkof thePayment Payload. -
Facilitatorwaits for the payment to be confirmed on the blockchain. -
Facilitatorreturns aPayment Execution Responseto the server. -
Serverreturns a200 OKresponse to theClientwith the resource they requested as the body of the HTTP response, and aPAYMENT-RESPONSEheader containing theSettlement Responseas Base64 encoded JSON if the payment was executed successfully.
How MUSD fits into x402
Section titled “How MUSD fits into x402”- Network identifier: CAIP-2 strings are used to identify the Mezo Network.
Mezo Testnet is
eip155:31611, Mezo Mainnet iseip155:31612(x402 will not accept short names like"mezo-testnet"). - Asset resolution: x402 prices are dollar strings (
price: "$0.01").@x402/evm’sDEFAULT_STABLECOINSregistry mapseip155:31611→ MUSD (0x118917a40FAF1CD7a13dB0Ef56C86De7973Ac503, 18 decimals). You do not hardcode an asset address in route configs. - Signing: MUSD is a
permit2+ EIP-2612 token, so payment authorization is a single EIP-712 signature, with no on-chain approval transaction and no gas on the buyer’s side. - Facilitator: Mezo Testnet is settled by
https://facilitator.vativ.io(A mainnet facilitator URL will be published when MUSD payments activate on Mezo Mainnet)
Why Mezo for x402
Section titled “Why Mezo for x402”Most chains that support x402 settle in USDC. Mezo’s pitch is different:
- Bitcoin-native settlement asset. MUSD is minted against BTC collateral in the Mezo economy. Revenue denominated in MUSD stays in the Bitcoin ecosystem without a round-trip through ETH or centralized stablecoin issuers.
- 18-decimal precision for true micropayments. A $0.001 charge is a first-class operation, not a rounding artifact. Metered APIs, per-inference AI pricing, and per-request content access can price realistically without batching.
- Zero gas for buyers (facilitator pays in BTC). The Mezo
facilitator at
facilitator.vativ.iosponsors every on-chain settle transaction in native BTC. Buyers (including AI agents) only need MUSD to spend and a private key to sign an EIP-712 permit2 authorization; no BTC gas top-up, no bridged gas token, no pre-funding step before the first payment. - Predictable chain economics. Mezo is purpose-built around Bitcoin-backed financial primitives, so MUSD supply and borrowing costs follow rules anchored to the BTC collateral base rather than stablecoin issuer policy.
What you can build
Section titled “What you can build”x402 + MUSD on Mezo is a fit anywhere a seller wants HTTP-native pricing without managing subscriptions, API keys, or payment-processor accounts:
- Paywalled content. Articles, streams, reports, research dumps.
One
402per protected URL, priced per asset. - Metered APIs. Charge per request for weather data, crypto feeds, analytics endpoints, or custom business logic. No rate-limit dance, no API-key lifecycle to manage.
- Pay-per-inference AI services. Wrap an LLM, image generator, STT, embedding, or fine-tuned model in an x402 endpoint. Callers pay per invocation at true-cost pricing enabled by 18-decimal MUSD.
- Machine-to-machine (M2M) payments. AI agents equipped with an
@x402/fetchclient and a private key transact autonomously: discover a paid tool, read the402requirements, settle, consume. No accounts, no credential exchange, no human-in-the-loop per payment. With facilitator-sponsored gas, the agent only needs MUSD and a signing key; no BTC top-up to start transacting. - Paid MCP servers. Expose agent tools via the Model Context Protocol and price them per call through x402. Pairs naturally with autonomous-agent consumers.
- Usage-based SaaS substitution. Replace subscription billing with per-use pricing for tools, dashboards, or internal services where usage is bursty or uncertain.
Getting Started
Section titled “Getting Started”For a step-by-step walkthrough (install the SDK packages, build a
seller with @x402/express, exercise the paywall flow with a browser
wallet, run a programmatic @x402/fetch client), see the
Quickstart for x402 guide.
See also
Section titled “See also”- Quickstart for x402. The step-by-step hands-on guide.
- Set Up Developer Environment. Mezo RPC endpoints and network parameters.
- Network & RPC. Chain configuration details.
- Borrow and Mint MUSD ↗. User-side flow for acquiring MUSD (opens in new tab).
- x402.org. Canonical x402 protocol documentation.