Pay per call. No account, no API key.
Agents pay for Shield in USDG with a signature: the payment is the login. And any API on Robinhood Chain can take x402 payments through Heimdall's facilitator, the only one that checks the recipient with Shield before money moves.
USDGRobinhood Chain
- x402 standard
How a paid call works
- 01402 with a priceWhen the free tier is used up, the API answers 402 Payment Required with the price, the asset (USDG) and where to pay.
- 02The agent signsThe agent signs a USDG transfer authorization (EIP-3009). No gas for the agent, and it can never be charged more than it signed.
- 03Settled, then servedHeimdall checks the recipient, settles the transfer onchain in about a second, and the request goes through.
Pay for Shield
Wrap fetch once. The SDK pays only when an API asks, and never above the cap you set.
import { payX402, HeimdallShield } from "@heimdallfund/sdk";
// at most 0.01 USDG per call; the wallet needs USDG, no ETH
const fetchPaid = payX402(fetch, agentWallet, { maxAmount: 10_000n });
const shield = new HeimdallShield({ fetch: fetchPaid });
await shield.check({ from, to, data, value }); // free tier first, then paid{
"mcpServers": {
"heimdall": {
"command": "npx",
"args": ["-y", "@heimdallfund/mcp"],
"env": { "HEIMDALL_X402_PRIVATE_KEY": "0x…", "HEIMDALL_X402_MAX": "5000" }
}
}
}A facilitator that checks first
Standard x402 v2 endpoints. Before it settles, the facilitator refuses payments to addresses on Heimdall's blocklist, so a hijacked payTo never gets paid.
// your API: answer 402, then let Heimdall verify and settle
const accepts = [{
scheme: "exact", network: "eip155:4663",
asset: "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168", // USDG
amount: "10000", payTo: YOUR_WALLET, maxTimeoutSeconds: 60,
extra: { name: "Global Dollar", version: "1" },
}];
const r = await fetch("https://api.heimdall.fund/x402/settle", {
method: "POST",
body: JSON.stringify({ x402Version: 2, paymentPayload, paymentRequirements: accepts[0] }),
}).then((r) => r.json()); // { success, transaction, payer }Questions,
answered.
Does the agent need ETH?+
No. The agent only signs; Heimdall's facilitator submits the transfer and pays the gas.
Can a server charge more than it said?+
No. The signature fixes the exact amount, the recipient and a short expiry. The SDK also refuses any price above your cap.
Is the free tier still free?+
Yes. x402 starts when the free limit is used up, as an alternative to an API key. API keys keep working the same way.
What does the facilitator cost?+
Nothing for now: Heimdall pays the gas. Payments below 0.001 USDG are not settled, so nobody can make it burn gas on dust.
Which x402 versions?+
v2 (PAYMENT-SIGNATURE header, eip155:4663) and v1 bodies (X-PAYMENT, network "robinhood"), exact scheme with EIP-3009. USDG's signing domain is "Global Dollar", version "1".
Plug your API into agents
Use the facilitator from any x402 server, and your endpoints show up in discovery.