x402-payments
Installation
SKILL.md
x402 Protocol Skill
Protocol Overview
x402 embeds stablecoin payments into HTTP by using the 402 "Payment Required" status code. A server responds with payment requirements; the client signs a payment authorization, resubmits the request, and gets the resource after verification and settlement.
Payment flow:
- Client sends HTTP request → Server returns
402+PAYMENT-REQUIREDheader (base64 JSON) - Client reads requirements, creates signed payment payload
- Client resubmits request with
PAYMENT-SIGNATUREheader (base64 JSON) - Server verifies payment via facilitator
POST /verify - Server performs work, settles via facilitator
POST /settle - Server returns
200+ resource +PAYMENT-RESPONSEheader (contains txHash)
Key concepts:
- Facilitators verify and settle payments without holding funds. Use
https://x402.org/facilitatorfor testnet, CDP facilitator for mainnet. - Schemes:
exact(fixed price per request) is the production scheme.uptoanddeferredare proposed. - Networks: Identified by CAIP-2 format —
eip155:84532(Base Sepolia),eip155:8453(Base Mainnet),solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1(Solana Devnet). - EVM uses EIP-3009 gasless
TransferWithAuthorization. Solana uses SPL token transfers.