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, fixed-price routes under /x402/ |
| MPP Tempo charge (pull) | Tempo mainnet chain 4217, USDC.e, routes under /v1/ (catalog and fixed-price) |
| Card (Stripe) | Prepaid token packages; see Packages |
Errors
| Status | Meaning | Charged? |
|---|---|---|
| 400 | client_nonce_required, bad_client_nonce, wrong rail for the URL, invalid body | No |
| 402 | Payment required: the quote for this request | No |
| 404 | model_not_found: see catalog | No |
| 409 | Credential already used with a different nonce or request | No |
| 422 | price_exceeds_rail_cap: the quote is above the per-call cap of the pay-per-call rail; retry with a lower max_tokens | No |
| 429 | too_many_requests: one client IP is requesting challenges too fast; honour Retry-After | No |
| 502 | upstream_error: the model produced no usable result | No |
| 503 | upstream_unavailable or selling_paused: try again later | No |