Skip to content

x402 Payments

x402 is an open protocol built on the HTTP 402 status code. Any web resource can require a small EURD payment before serving content or data. AI agents pay automatically and retry — no registration, no billing portal, no API key exchange.

Quantoz supports two x402 schemes. Pick based on what kind of settlement you need:

euro schemeexact scheme (Algorand)
SettlementOff-chain via Quantoz APIOn-chain EURD on Algorand
Agent needsQuantoz managed accountWhitelisted Algorand wallet, or Quantoz account (bridge)
Merchant needsQuantoz managed accountWhitelisted Algorand wallet
SpeedInstant~5 sec (direct) / ~1–3 min (bridge)
Facilitatormcp.ai.quantozpay.com/x402x402algo.ai.quantozpay.com
Best forQuickest integration, agent-to-agentOn-chain settlement, DeFi composability

Start with the euro scheme unless you specifically need on-chain settlement. It requires no blockchain knowledge and settles instantly.

1. Agent requests a resource
GET /premium-resource (no payment)
2. Server responds 402 with payment options
{ accepts: [{ scheme: "euro", amount: "0.10", ... }] }
3. Agent pays and retries with proof
GET /premium-resource
X-PAYMENT: <base64url proof>
4. Server verifies → serves resource
200 OK

The withEurPayment() npm package handles steps 3–4 automatically for both schemes. See the agent developer guide.

Off-chain payments between Quantoz managed accounts. The facilitator handles payment creation and verification.

{
"scheme": "euro",
"network": "quantoz:mainnet",
"asset": "EURO",
"amount": "0.10",
"payTo": "ACC_your_account",
"paymentRequestCode": "pr_...",
"expiresAt": 1234567890,
"facilitator": "https://mcp.ai.quantozpay.com/x402"
}

Replay protection is handled by the facilitator — each payment request code can only be verified once.

On-chain EURD transfers on Algorand. The Algorand facilitator validates and submits transactions.

{
"scheme": "exact",
"network": "algorand:mainnet",
"asset": "1221682136",
"maxAmountRequired": "50",
"payTo": "YOUR_ALGORAND_ADDRESS",
"maxTimeoutSeconds": 300,
"facilitator": "https://x402algo.ai.quantozpay.com"
}

Amounts are in atomic units — EURD has 2 decimal places, so €0.50 = 50.

Agents can pay this scheme either directly (with an Algorand wallet) or via the EURO→Algorand bridge (Quantoz account only, no Algorand wallet needed on the agent side).