Cross-chain x402 payments
Pay on any chain.
Get paid on any chain.
x402Interop extends upstream x402 with cross-chain payment flows, a facilitator, and a marketplace where buyers discover services and sellers publish endpoints. Cross-chain settlement runs on NEAR Intents.
Two lines to start
Protect a route. Pay from anywhere.
The same x402 flow from both sides. Snippets are taken from the quickstart and the API reference.
import { x402interop } from '@x402interop/servers/express'
app.get(
'/api/report',
x402interop({
facilitator: process.env.FACILITATOR_URL,
apiKey: process.env.FACILITATOR_API_KEY,
payTo: process.env.SELLER_ADDRESS,
network: 'sui:mainnet',
asset: process.env.SELLER_ASSET,
price: '0.20',
amount: '200000',
deliveryMode: 'on_deposit',
mintQuotes: true,
buyerNetwork: 'eip155:8453',
buyerAsset: 'nep141:base-usdc.omft.near',
}),
(req, res) => res.json({ report: '…' }),
)import { wrapFetchWithInterop } from '@x402interop/client'
const fetchWithInterop = wrapFetchWithInterop(fetch, { spendControls: false })
const res = await fetchWithInterop('https://seller.example/api/report', {
headers: { accept: 'application/json' },
})
// 1st call → 402 with PAYMENT-REQUIRED
// wrapper signs and retries with PAYMENT-SIGNATURE
// 2nd call → 200 with the report and PAYMENT-RESPONSEimport { createInteropFacilitator } from '@x402interop/facilkit'
// Quote, verify, settle, status and MCP over HTTP.
// createInteropFacilitator(options) - see the facilitator guide for the options.
const facilitator = createInteropFacilitator(options)What it does
An open-source cross-chain facilitator, scheme family, and discovery layer for x402.
Pay from anywhere
Pay on your chain: the buyer signs a gasless payment on its own chain - no bridge, no extra wallet.
Get paid on yours
Settle on your chain: the seller receives an exact amount on its own chain via NEAR Intents.
Discover anything
Find services across chains: one search across federated catalogs, exposed as MCP tools.
Fast enough for HTTP
Tiered delivery keeps the swap off the critical path.
Bitcoin included
BTC holders top up over Lightning and spend as stablecoin.
No float
Facilitator never fronts liquidity: zero facilitator float - the facilitator never fronts its own money.
Start here
Choose your path into the docs.
Seller
Protect a route
Add the x402interop middleware, pick a delivery mode, register in discovery.
Read the guideBuyer
Pay for a resource
Wrap fetch with an interop-aware x402 client, sign and retry.
Read the guideFacilitator
Run a facilitator
createInteropFacilitator - quote, verify, settle, status, MCP.
Read the guideAgent
MCP & agents
search_services, prepare_payment, pay_and_fetch, payment_status, get_credit.
Read the guide
Supported chains
Day-one chains from the chain reference. Settlement runs on NEAR Intents.
- Base
- Arbitrum One
- Ethereum
- Optimism
- Polygon
- Avalanche C-Chain
- BNB Smart Chain
- Berachain
- Plasma
- Monad
- X Layer
- Scroll
- Bitcoin
- Bitcoin Cash
- Litecoin
- Dash
- Zcash
- Dogecoin
- Aptos
- NEAR
- Solana
- Stellar
- Sui
- TON
- TRON
- XRP Ledger
- Starknet
- Lightning