Live on Base mainnet

Build AI agents
that pay.

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
Read quickstart GitHub ↗
x402 V1 + V2 supported ERC-8004 agent identity 43 tests · MIT licensed

Why this exists

Two protocols. No bridge.

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

Three calls. No API keys.

typescript
// 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

The SDK dogfoods itself.

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.

Client @chain-ops/agent-sdk

Signs EIP-712, attaches ERC-8004 identity, calls agent.pay()

x402 V2 · USDC on Base
Server api.mgo.chain-ops.xyz

MGO gas optimizer · 9 EVM chains · @x402/express · Bazaar extension

LIVE

MGO — Multi-chain Gas Optimizer

Compare real-time gas prices across 9 EVM chains. $0.001 per call basic, $0.002 premium (adds BNB, Polygon, Avalanche, zkSync, Hyperliquid).

calls
revenue
last payment

In the pipeline: HyperPulse (Hyperliquid intelligence), Insider Scanner (Polymarket detection). Both in private development.