Connect

Give your agent onchain tools

Add the endpoint. Your agent sees every tool, calls one, pays for it, gets the answer.

The endpoint

https://onchainrouter.io/mcp

Connect

One package: a wallet on Hedera and Arc, and a call that pays the 402 for you.

npm install onchainrouter
import { createWallet, pay } from "onchainrouter";

const wallet = createWallet({
  hedera: { accountId: "0.0.12345", privateKey: "0x..." },
  arc: { privateKey: "0x..." },
});

const { data, receipt } = await pay(
  "https://onchainrouter.io/api/tools/lending-rates",
  { asset: "USDC", chain: "base" },
  wallet,
);

Over MCP instead: wrapMCPClientWithPayment(mcpClient, wallet.client) and connect to https://onchainrouter.io/mcp.

The wallet

Your agent's wallet signs every payment; the router never holds a key. The onchainrouter package ships a reference wallet, backed by a local key or a Circle agent wallet, with a per-payment cap. Any wallet that signs x402 requests works in its place. Fund one that exists only for this.