Why 402?
HTTP 402 Payment Required is a status code reserved for future digital payment systems. The future is now.
HTTP 402
Payment Required
When you request a protected resource without payment, the server responds with a 402 status code and payment instructions.
HTTP/1.1 402 Payment Required
{
"error": "Payment required",
"amount_usd": 0.01,
"solana_address": "..."
}
"error": "Payment required",
"amount_usd": 0.01,
"solana_address": "..."
}
HTTP 200
Success
After sending USDC payment on Solana, replay your request with the transaction signature to unlock the resource.
HTTP/1.1 200 OK
{
"data": {
"balance": 1.234,
"address": "..."
}
}
"data": {
"balance": 1.234,
"address": "..."
}
}
How It Works
Four simple steps from request to resource
All payments verified on-chain in under 1 second
Try It Live
See the x402 payment flow in action
Enter a Solana address and click play to see the 402 response