Payments
x402 Payments
x402 is an open-source protocol that turns the dormant HTTP 402 Payment Required status code into a fully-featured, on-chain payment layer for APIs, websites, and autonomous agents.
Learn more about the protocol at x402.org.
x402 Playground
Try out x402 payments in our live playground
wrapFetchWithPayment wraps the native fetch API to automatically handle 402 Payment Required responses from any x402-compatible API:
To make your API calls payable, use the settlePayment function in a middleware or endpoint: