minia2a

payagent + minia2a

Discovery meets payment. minia2a finds the x402 APIs. payagent pays them. Your agent code stays clean.

x402 USDC Base L2 npm install payagent minia2a.uk

ARCHITECTURE

Your Agent
TypeScript / Python
minia2a
Discover services
payagent
Pay HTTP 402
Any x402 API
173+ on minia2a

The Problem

Your AI agent needs to call external APIs — gas oracles, token security checks, web scraping, Polymarket data. But those APIs cost money, and your agent can't fill out a credit card form or complete OAuth.

That's the gap the x402 protocol (HTTP 402 Payment Required) fills. And two tools make it practical:

1 Discover services on minia2a

minia2a lists 173+ x402 endpoints across categories like gas, token security, DeFi data, web tools, and more. Your agent can query the directory to find the services it needs.

# List all x402 services (JSON)
curl https://minia2a.uk/api/stats | python3 -c "
import sys, json
d = json.load(sys.stdin)
for ep, data in sorted(d.get('trials',{}).get('byEndpoint',{}).items(), key=lambda x: -x[1].get('used',0)):
    if ep.startswith('x402-'):
        print(f'{data[\"used\"]:>5} trials — {ep}')
" | head -15

Popular endpoints right now:

EndpointWhat it doesCost
x402-gasLive gas prices (ETH, Base, Arbitrum)1 credit
x402-captcha-solveSolve CAPTCHAs programmatically1 credit
x402-web-scrapeScrape any webpage, returns clean text1 credit
x402-token-securityCheck token for honeypots, taxes, ownership1 credit
x402-polymarketReal-time Polymarket odds and data1 credit
x402-wallet-intelAnalyze any wallet's activity and risk1 credit

2 Install payagent

payagent gives you a drop-in fetch replacement that handles HTTP 402 responses transparently. When an API returns "402 Payment Required", payagent pays it with USDC (via ArisPay's delegated custody) and retries.

npm install payagent
🔐 No private keys in your code. payagent uses ArisPay's delegated custody — Coinbase CDP holds the signing key, ArisPay enforces spending limits server-side. You set per-transaction, daily, and monthly caps upfront.

3 Wire them together

Here's the complete pattern: query minia2a to discover services, then call them through payagent's payment-aware fetch.

import { DelegationClient, payFetchDelegated } from 'payagent';

// ── Setup: provision an agent wallet via ArisPay ──
const client = new DelegationClient(
  'https://api.arispay.app',
  process.env.ARISPAY_KEY
);
const agent = await client.createX402Agent({
  name: 'my-research-agent',
  maxPerTx: 100,       // $1.00 max per call
  maxDaily: 1000,      // $10/day cap
  maxMonthly: 10000,   // $100/month cap
  allowedDomains: ['minia2a.uk'],  // services proxied through minia2a
});

// Fund wallet with USDC on Base, then wait
console.log('Deposit USDC to:', agent.walletAddress);
await client.pollUntilFunded(agent.agentId);

// ── Create payment-aware fetch ──
const payFetch = payFetchDelegated({
  arispayUrl: 'https://api.arispay.app',
  apiKey: agent.apiKey,
});

// ── Discover a service on minia2a ──
const registry = await fetch('https://minia2a.uk/api/stats');
const { services } = await registry.json();
console.log(`${services} x402 services available on minia2a`);

// ── Call any x402 service — payment handled automatically ──
const gas = await payFetch(
  'https://minia2a.uk/x402/gas',
  { headers: { 'Content-Type': 'application/json' } }
);
const { ethereum, base, arbitrum } = await gas.json();
console.log(`Gas now — ETH: ${ethereum}, Base: ${base}, Arb: ${arbitrum}`);

// ── Or call multiple services in parallel ──
const [tokenReport, gasData] = await Promise.all([
  payFetch('https://minia2a.uk/x402/token-security', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ token: '0x...' }),
  }).then(r => r.json()),
  payFetch('https://minia2a.uk/x402/gas').then(r => r.json()),
]);

console.log('Token risk:', tokenReport.risk);
console.log('Base gas:', gasData.base);

4 No payagent? Use minia2a directly

Even without payagent, you can call minia2a services. Register to get 500 free credits (1 credit = $0.005, 1 USDC = 200 credits), then call any endpoint:

# 1. Register (one command — auto-creates a wallet)
curl -X POST https://minia2a.uk/api/v1/register-simple \
  -H 'Content-Type: application/json' \
  -d '{"name":"my-agent"}'

# Response: {"wallet":"0x...","privateKey":"0x...","credits":500}

# 2. Pay-per-call with your wallet
curl "https://minia2a.uk/x402/gas" \
  -H "X-Wallet: 0xyourwallet"
⚡ Tip: minia2a's auto-wallet means you don't need payagent at all for testing. Register → get 500 credits → call APIs immediately. payagent adds value when you graduate to production with delegated custody, spending limits, and non-custodial key management.

minia2a vs. payagent — what each does

minia2apayagent
Service discovery✅ 173+ endpoints, searchable
HTTP 402 payment✅ Credits / wallet-based✅ Delegated custody via ArisPay
Key managementYou hold the keyCDP holds the key
Spending limitsCredit balance = limitPer-tx, daily, monthly caps
Setup time1 curl commandnpm install + ArisPay key
Best forQuick start, testing, indie agentsProduction, teams, compliance
🎁 Register — 500 Free Credits 📋 Browse 173 Services 📖 More Code Recipes