Pay-per-call on-chain data for AI agents, priced in USDC on Base.
Start with MGO: live gas comparison across 9 EVM chains from $0.001 per call. No API key, no subscription.
npm install @chain-ops/agent-sdk viem
Why this exists
x402
gives AI agents a payment rail.
ERC-8004
gives them an on-chain identity.
They don't talk to each other yet.
Until now, wiring them together meant five manual steps — mint the identity, set up the payment middleware, attach the identity to each request, update reputation after settlement, and check trust before sending money.
@chain-ops/agent-sdk gives you the payment call, the identity registration and the trust lookup in one package. Automatic identity attachment and reputation updates are on the roadmap.
Quickstart
// 1. Create an agent from a private key
import { createAgent } from "@chain-ops/agent-sdk";
const agent = createAgent({
account: process.env.PRIVATE_KEY as `0x${string}`,
network: "base",
});
// 2. Register on ERC-8004 (one-time)
await agent.registerAgent({
name: "my-gas-optimizer",
description: "Finds the cheapest EVM chain",
tags: ["gas", "evm"],
});
// 3. Pay for any x402 resource: 402 → sign USDC authorization → retry, handled for you
const { body } = await agent.pay(
"https://api.mgo.chain-ops.xyz/gas/basic"
);
// → { recommendation: { cheapestChain: "Optimism", action: "Use Optimism — saves ~97% vs Ethereum" } }
x402 V1 + V2. EIP-3009 USDC authorization signed for you. One call, no API key. Read the full docs →
In production
Our own gas-optimizer API, MGO, runs on @x402/express and accepts payments from
@chain-ops/agent-sdk or any x402 client. Every paid call settles in USDC on Base mainnet.
@chain-ops/agent-sdk
Reads the 402, signs the USDC authorization, retries: agent.pay()
api.mgo.chain-ops.xyz
MGO gas optimizer · 9 EVM chains · @x402/express · Bazaar extension
Compare real-time gas prices across 9 EVM chains. $0.001 per call basic, $0.002 premium (adds BNB, Polygon, Avalanche, zkSync, Hyperliquid).
Also from chain-ops: x402Hub (trust board for x402 services, live), HyperPulse (Hyperliquid perp intelligence, live), Insider Scanner (Polymarket detection, paused).