Make your first paid request with x402
This guide takes one Solana request through x402: read the price, pay it, and get the answer with a settlement receipt. The other 15 chains work the same way at their own routes.
You need a wallet that holds USDC on Solana, or USDC or EURC on Base, and an x402 client: the software that reads the 402 response, signs a payment from your wallet and sends the request again with it. For x402 clients, see the x402 documentation at x402.org.
1. Send the request
Send the RPC request without a payment:
bash
The answer is 402 Payment Required. Its headers give the method and the price:
http
The body lists the payment options in
accepts, one for each stablecoin the request can be paid with. amount is in the stablecoin's smallest unit, so 1000 is 0.001 USDC, or 0.001 EURC:json
2. Pay with an x402 client
Give the 402 response to your x402 client. It picks an option your wallet can pay, signs a payment for that amount and encodes it for the X-Payment header. The payment needs no SOL or ETH for network fees.
3. Send the request again with the payment
Send the same body again, with the payment in the X-Payment header:
bash
Keep the body unchanged. The price is worked out from the body, so if a changed body has a different price, the payment no longer matches it and is answered with
price_mismatch.Once the payment is verified and settled, the RPC answer comes back with the settlement receipt in the X-Payment-Response header:
http
json
A payment pays for one request. If you send the same payment again, it is refused with 402
payment_invalid or 409 duplicate_payment, and the request is not forwarded again.Responses
A request that x402.erpc.global answers with an error before it asks for payment costs nothing.
On Solana, a call that would read too much, such as an unfiltered
getProgramAccounts on a large program, is answered with HTTP 200 and a JSON-RPC error before any payment is asked for, so it costs nothing.Next steps
- How x402 prices a request: the price of one call, the $0.001 minimum and batches.
- x402 overview: every chain's route and the payment options.
- OpenAPI document: the request and response shape of every route.






