One-line x402 payments with ERC-8004 identity.
Pay, prove, reputation — in a single call. USDC on Base.
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 does all of it in one call.
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 — identity attached automatically
const { body } = await agent.pay(
"https://api.mgo.chain-ops.xyz/gas/basic"
);
// → { recommendation: "Use Base — saves 99.8% vs Ethereum" }
ERC-8004 identity attached. EIP-712 signed. Trust checked. One call. Read the full docs →
In production
Our own gas-optimizer API runs on @x402/express and is paid by agents running
@chain-ops/agent-sdk. Every call on this site touches Base mainnet.
@chain-ops/agent-sdk
Signs EIP-712, attaches ERC-8004 identity, calls 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).
In the pipeline: HyperPulse (Hyperliquid intelligence), Insider Scanner (Polymarket detection). Both in private development.