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.
Two payment schemes
Section titled “Two payment schemes”Quantoz supports two x402 schemes. Pick based on what kind of settlement you need:
euro scheme | exact scheme (Algorand) | |
|---|---|---|
| Settlement | Off-chain via Quantoz API | On-chain EURD on Algorand |
| Agent needs | Quantoz managed account | Whitelisted Algorand wallet, or Quantoz account (bridge) |
| Merchant needs | Quantoz managed account | Whitelisted Algorand wallet |
| Speed | Instant | ~5 sec (direct) / ~1–3 min (bridge) |
| Facilitator | mcp.ai.quantozpay.com/x402 | x402algo.ai.quantozpay.com |
| Best for | Quickest integration, agent-to-agent | On-chain settlement, DeFi composability |
Start with the euro scheme unless you specifically need on-chain settlement. It requires no blockchain knowledge and settles instantly.
How x402 works (both schemes)
Section titled “How x402 works (both schemes)”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 OKThe withEurPayment() npm package handles steps 3–4 automatically for both schemes. See the agent developer guide.
The euro scheme
Section titled “The euro scheme”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.
The exact scheme (Algorand)
Section titled “The exact scheme (Algorand)”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).
Next steps
Section titled “Next steps”- Merchants — Protect a resource with x402
- AI developers — Pay x402 resources from an agent