Skip to content
Sign in
Menu

Introduction to x402

The HTTP 402 payment model, the x402 headers, and how NODRA uses them.

On this page

HTTP 402 Payment Required

HTTP has reserved status 402 Payment Required since its early days, without saying how payment should work. x402 is an open protocol that fills the gap: a server answers 402 with machine-readable payment requirements, the client pays, and the client repeats the request with proof of payment. No accounts, sessions or API keys are involved.

The three headers

Each value is base64-encoded JSON.
HeaderDirectionCarries
PAYMENT-REQUIREDGateway → client, on 402The quote: what to pay, where and on which network.
PAYMENT-SIGNATUREClient → gateway, on the retryThe client's signed payment for that quote.
PAYMENT-RESPONSEGateway → client, on the paid answerThe receipt: whether the payment settled, and its transaction.

How NODRA uses x402

AspectNODRA
x402 version2. The version 1 X-PAYMENT header isn't accepted.
Schemeexact: pay exactly the quoted amount.
NetworkSolana, named by its CAIP-2 id in each quote.
AssetUSDC, named by its mint address in each quote.
Recipient (payTo)The API's vault, a program-derived address. The transfer goes to the vault's USDC token account.
Fee payerNODRA. The client's transaction names NODRA's fee payer; NODRA co-signs when it settles. Clients need no SOL.
Quote idCarried in extra.memo and required as the transaction's memo, so each payment names the quote it pays.
When payment settlesAfter the provider answers billably (serve first). See Verification and settlement.

Why x402 suits agents

  • Machine-readable prices: an agent sees the exact cost before deciding.
  • No onboarding: a wallet is the only prerequisite.
  • Per-call settlement: no balances held with the provider, no invoices.
  • Bounded risk: each payment is for one call, for one quoted amount, and expires in seconds.