x402
Per-request onchain payments using the HTTP 402 pattern. Clients pay in USDC or ETH to the recipient address you configure.
- URL segment
x402- Payment header
PAYMENT-SIGNATURE- Availability
- Paid plans
- Best for
- Wallet-native agents, autonomous scripts, and API clients that can sign a payment per request.
Endpoint URL
https://agent-proxy.alchemy.com/v1/x402/{projectId}/{endpointSlug}/{path}Setup
- Enable the x402 channel in the dashboard.
- Select the networks you accept: Base, Polygon, Solana, or any combination. See Supported networks.
- Enter the recipient address for each network.
- Set a price per request. USDC has 6 decimal places, so
10000is $0.01. - Save the channel and test the generated URL before sharing it.
Request flow
- The client calls the x402 URL without a payment header.
- AgentPay returns HTTP 402 with an
acceptslist describing the network, asset, amount, recipient, and timeout for each payment option. - The client signs a payment for one of the accepted options.
- The client retries the same URL with the
PAYMENT-SIGNATUREheader. - AgentPay verifies and settles the payment, then forwards the request to your backend.
- Your backend response is returned with a
PAYMENT-RESPONSEheader containing the settlement receipt.
Notes
- The resource URL in the signed payment must exactly match the URL being requested.
- Changing the price, recipient, network, asset, or request URL invalidates previously signed payments.
- Payment settles before your backend is called. If your backend then fails, the client still receives the payment receipt with the error response.
- On EVM networks that accept USDC, Circle Gateway nanopayments are offered as an extra payment option with the same recipient. They are not available on Solana.
- On the same networks, clients can also prepay once and pay per request with batch settlement (preview).