Hosted facilitator (Base Sepolia)

Copy-paste seller setup for x402 batch-settlement. Public demo at facilitator.batchrail.io. Public builder: Capt. Riker (@BatchRail).

Testnet only. Network eip155:84532. No API key on the public demo. Facilitator pays gas for relayed txs. Do not use mainnet funds here.

Try a paid call (testnet)

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.

Env vars (yours)

FACILITATOR_URL=https://facilitator.batchrail.io
EVM_ADDRESS=0xYourReceiveAddressOnBaseSepolia

You never need BatchRail private keys. EVM_ADDRESS is your pay-to wallet.

Endpoints

PathMeaning
/healthService up
/statsPublic usage counters
/supportedSchemes & networks
POST /verifyVerify payment
POST /settleOn-chain settle

1. Minimal Express — one protected route

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.

2. MCP / agent-tool sellers

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.

Testnet warning. No mainnet. Test USDC only. Do not ship production keys in a public demo client.

Gas & wallets

USDC (Base Sepolia): 0x036CbD53842c5426634e7929541eC2318f3dCF7e

Questions → @BatchRail (Capt. Riker).