// x402.md

> x402 Protocol

// Implement pay-per-request payments for your API endpoints.

// overview

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.

1.

Agent sends request to your endpoint

2.

Endpoint returns 402 with payment details (amount, network, address)

3.

Agent sends USDC payment on Base network

4.

Agent retries request with payment proof

5.

Endpoint verifies payment and returns the data

// 402 response format

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..."
  }
}
// required headers
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
// supported networks

Currently supported payment networks:

+ Base — USDC payments (primary)
+ Base Sepolia — testnet for development
// coinbase x402 bazaar

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.