Payment protocols

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

  1. Enable the x402 channel in the dashboard.
  2. Select the networks you accept: Base, Polygon, Solana, or any combination. See Supported networks.
  3. Enter the recipient address for each network.
  4. Set a price per request. USDC has 6 decimal places, so 10000 is $0.01.
  5. Save the channel and test the generated URL before sharing it.

Request flow

  1. The client calls the x402 URL without a payment header.
  2. AgentPay returns HTTP 402 with an accepts list describing the network, asset, amount, recipient, and timeout for each payment option.
  3. The client signs a payment for one of the accepted options.
  4. The client retries the same URL with the PAYMENT-SIGNATURE header.
  5. AgentPay verifies and settles the payment, then forwards the request to your backend.
  6. Your backend response is returned with a PAYMENT-RESPONSE header 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).