402 Payment Required
status code into a fully-featured, on-chain payment layer for APIs, websites, and autonomous agents.
x402PaymentPayload
is signed by the buyer and settles directly on-chain.$0.001
per request)/basic
vs /pro
endpoints with different prices)Network | Asset | Fees* | Status |
---|---|---|---|
Base | USDC | fee-free | Mainnet |
Base Sepolia | USDC | fee-free | Testnet |
exact
scheme is a push payment—irreversible once executed. Two options:
402 JSON (accepts array)
.X-PAYMENT
.viem
, ethers-v6
HD wallets) let agents sign EIP-712
payloads without exposing seed phrases.
upto
, stream
, permit2
)402 Payment Required
, even after attaching X-PAYMENT
. Why?maxAmountRequired
.error
field in the server’s JSON response for details.network: "base"
(not "base-sepolia"
).