Copy-paste seller setup for x402 batch-settlement. Public demo at facilitator.batchrail.io. Public builder: Capt. Riker (@BatchRail).
eip155:84532.
No API key on the public demo. Facilitator pays gas for relayed txs.
Do not use mainnet funds here.
Live example resource — no repo clone required:
A normal browser gets HTTP 402 (expected). An x402 client pays with Base Sepolia test USDC (batch-settlement), retries, and receives a small JSON payload. Uses facilitator.batchrail.io.
FACILITATOR_URL=https://facilitator.batchrail.io EVM_ADDRESS=0xYourReceiveAddressOnBaseSepolia
You never need BatchRail private keys. EVM_ADDRESS is your pay-to wallet.
| Path | Meaning |
|---|---|
| /health | Service up |
| /stats | Public usage counters |
| /supported | Schemes & networks |
POST /verify | Verify payment |
POST /settle | On-chain settle |
import express from "express";
import { paymentMiddlewareFromHTTP, x402ResourceServer } from "@x402/express";
import { HTTPFacilitatorClient } from "@x402/core/server";
import { BatchSettlementEvmScheme } from "@x402/evm/batch-settlement/server";
const NETWORK = "eip155:84532"; // Base Sepolia testnet
const payTo = process.env.EVM_ADDRESS;
const facilitatorClient = new HTTPFacilitatorClient({
url: process.env.FACILITATOR_URL ?? "https://facilitator.batchrail.io",
});
const batchScheme = new BatchSettlementEvmScheme(payTo);
const resourceServer = new x402ResourceServer(facilitatorClient)
.register(NETWORK, batchScheme);
const app = express();
app.get(
"/weather",
paymentMiddlewareFromHTTP(
{
accept: [{
scheme: "batch-settlement",
network: NETWORK,
payTo,
maxAmountRequired: "10000",
resource: "https://your-host.example/weather",
description: "Test weather (Base Sepolia)",
mimeType: "application/json",
}],
},
resourceServer
),
(_req, res) => res.json({ ok: true, note: "paid on testnet" })
);
app.listen(4021);
Full examples: github.com/BatchRail/core.
Same facilitator. One paid tool endpoint on Base Sepolia:
FACILITATOR_URL=https://facilitator.batchrail.io EVM_ADDRESS=0xYourAddress NETWORK=eip155:84532 // testnet only // On tool call: // 1) 402 + batch-settlement requirements (network + payTo) // 2) verify/settle via FACILITATOR_URL // 3) run tool, return result
Use the same BatchSettlementEvmScheme + HTTPFacilitatorClient as Express; only the MCP/HTTP adapter differs.
USDC (Base Sepolia): 0x036CbD53842c5426634e7929541eC2318f3dCF7e
Questions → @BatchRail (Capt. Riker).