import express from "express";
import {paymentMiddleware} from "x402-express";
app.use(payTo, routes, {
url: "https://facilitator.heurist.xyz"
})Scale with confidence. Our transaction management system is built for high-frequency requests.
Address a global audience. One endpoint, multiple ecosystems.
Meet regulatory requirements. Our facilitator automatically screens and blocks transactions from OFAC-sanctioned addresses.
Eliminate onboarding friction. Integrate in seconds with no API key needed.
Track your onchain revenue with a real-time dashboard to monitor API health, transaction volume, and earnings. (Coming Soon)
Accrue value without intervention. Automatically convert USDC revenue into your native project token on every settlement. (Coming Soon)
Start accepting agentic crypto payments in minutes.
npm i express x402-express
import express from "express";import { paymentMiddleware } from "x402-express";const app = express();// Monetize a route with x402. No API keys needed for the Heurist facilitator.app.use(paymentMiddleware("0xYourReceivingAddress",{"GET /api/paid": {price: "$0.01",network: "base",config: { description: "Paid endpoint (USDC)" }}},{ url: "https://facilitator.heurist.xyz" }));app.get("/api/paid", (req, res) => res.json({ ok: true, ts: Date.now() }));app.listen(3000, () => console.log("http://localhost:3000"));
402 with accepted options ⇒ client retries with X-PAYMENT (base64 JSON) ⇒ server verifies via /verify, settles via /settle, then returns 200. See the seller quickstart and set the facilitator URL to https://facilitator.heurist.xyz.