Herald Pr0t0c0l Docs ↗
Live on mainnet

Payment infrastructure
for AI agents

Protocol

How agent payment works

Any API or service returns a 402 Payment Required status. The client pays with USDC or any ERC20 token on 0G Chain.

👤
User Request
🔒
402 Payment Required
💳
Pay with USDC
Receive Data
Routing

How the router works

The router proxies requests to any protected service. When it receives a 402, it maps payment requirements to every supported network and rail — from 0G to another EVM chains, Solana, Stellar, Tempo, Stripe, and beyond.

👤
User Request
🔀
Router Proxies
🌐
402 + Map Networks
0G
Base
Arbitrum
Solana
Stellar
Tempo
Stripe
Card
💸
Pay & Forward
Receive Data
Integration

Start building

x402

Add the Herald facilitator to your server. Charge per request, per call, per artifact. Works with any x402 client. Settles on 0G in any ERC20 token.

Quickstart for sellers
server.ts TypeScript
import { paymentMiddleware, x402ResourceServer } from "@x402/hono";
import { HTTPFacilitatorClient } from "@x402/core/server";
import { ExactEvmScheme } from "@heraldprotocol/x402/server";

const facilitator = new HTTPFacilitatorClient({
  url: "https://facilitator.heraldprotocol.xyz",
});

app.use(paymentMiddleware({
  "GET /weather": {
    accepts: [{
      scheme: "exact",
      price: "$0.001",
      network: "eip155:16661",
      payTo: "0x...",
    }],
  },
}, new x402ResourceServer(facilitator)
  .register("eip155:16661", new ExactEvmScheme())));

MPP

Add MPP payment requirements to your server. Charge per request, per call, per artifact. Works with any MPP client. Settles directly on-chain — verify and broadcast payments yourself, no facilitator required.

Quickstart for sellers
server.ts TypeScript
import { zerog } from "@heraldprotocol/mpp/server";
import { Mppx } from "mppx/hono";

const mppx = Mppx.create({
  methods: [zerog({ recipient: account.address, account })],
});

app.get(
  "/weather",
  mppx.charge({ amount: "0.001" }),
  (c) => c.json({ weather: "sunny" })
);

Router

Pay any protected service (HTTP 402) from anywhere without bridging. The router accepts payment on 0G and forwards on the destination server or chain. MPP routing coming soon — settle on blockchain, Tempo, Stripe, card, or other fiat rails.

Overview
client.ts TypeScript
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";

const client = new x402Client();
client.register("eip155:16661", new ExactEvmScheme(signer));

const fetchWithPayment = wrapFetchWithPayment(fetch, client);

const url = "https://router.heraldprotocol.xyz/route/x402?url=" + dest;
await fetchWithPayment(url);
Now live on 0G

Agents transact.
Capital moves.