Payments and nonces
The 402 challenge
An unpaid request to a paid route returns HTTP 402 with the payment challenge for that URL: a WWW-Authenticate header on /v1/* (MPP) and a PAYMENT-REQUIRED header on /x402/* (x402). One rail per URL; the other rail on the same URL returns 400 and is not charged.
Settle after serve
Payment is settled only after the completion is produced. Requests that fail before a result is produced are not charged.
The client nonce
- Paid requests carry
X-Omni-Client-Nonce: <22-128 base64url characters>. It is required. - The client generates it randomly before paying, keeps it, and uses a fresh one for every payment.
- A missing or malformed nonce returns 400 (
client_nonce_requiredorbad_client_nonce) and the request is not charged. - The same credential with the same nonce returns the stored result of that payment without a second charge.
N=$(openssl rand -base64 24 | tr '+/' '-_' | tr -d '=')
Rails
| Rail | Detail |
|---|---|
| x402 v2 exact | Base (eip155:8453), USDC, routes under /x402/ |
| MPP Tempo charge (pull) | Tempo mainnet chain 4217, USDC.e, routes under /v1/ |