For the complete documentation index, see llms.txt. This page is also available as Markdown.

HTTP 402 Paywall Protocol

Overview

The HTTP 402 Paywall Protocol is the backbone of the 402Gate ecosystem. It extends the standard web request model with a payment verification layer, allowing any HTTP endpoint to enforce pay-per-use access powered by Solana and the $402G token.

When a client (human user, DApp, or AI agent) requests a protected resource, the server responds with a structured 402 Payment Required message that includes:

  • the amount to be paid,

  • the recipient wallet address,

  • the accepted tokens, and

  • the unique requestId for tracking and verification.

Once the user completes payment, the request is re-sent with proof of payment (a transaction signature) in the header. The server then verifies it on-chain and grants access immediately.


Request–Response Cycle

> GET /api/data
< HTTP/1.1 402 Payment Required
{
  "requestId": "req_492ab",
  "recipient": "MERCHANT_PUBKEY",
  "amount": "0.001",
  "currency": "402G",
  "acceptedMints": ["402G","USDC","SOL"],
  "instructions": "Pay the required amount and include memo=requestId"
}

After payment:

Last updated