> x402 Protocol
// Implement pay-per-request payments for your API endpoints.
The x402 protocol extends HTTP's 402 Payment Required status code
to enable machine-to-machine payments. When an agent calls your API without payment,
your endpoint returns a 402 with payment instructions. The agent pays, then retries with proof.
Agent sends request to your endpoint
Endpoint returns 402 with payment details (amount, network, address)
Agent sends USDC payment on Base network
Agent retries request with payment proof
Endpoint verifies payment and returns the data
Your endpoint must return this response for unpaid requests:
HTTP/1.1 402 Payment Required Content-Type: application/json X-Payment-Network: base X-Payment-Asset: USDC X-Payment-Amount: 0.001 X-Payment-Address: 0xYourAddress... { "error": "payment_required", "message": "Payment required to access this endpoint", "payment": { "network": "base", "asset": "USDC", "amount": 0.001, "address": "0xYourAddress..." } }
| Header | Value | Description |
|---|---|---|
| X-Payment-Network | base | Blockchain network for payment |
| X-Payment-Asset | USDC | Token to pay with |
| X-Payment-Amount | 0.001 | Price per call in USD |
| X-Payment-Address | 0x... | Wallet address to receive payment |
Currently supported payment networks:
EntRoute automatically ingests endpoints from the Coinbase x402 Bazaar — a public registry of x402-compatible APIs. If your endpoint is listed on the Bazaar, it will be automatically discovered and added to EntRoute with capability mapping and verification probing.