Skip to main content
A complete example of a REST API that charges per request using x402 micropayments.

Server

server.ts

Client

client.ts

Running the example

Each request triggers a separate micropayment. The client pays 100 units (0.0001 USDC) per API call.