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
1,703 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 1,703 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)~$0.005
x402-web-scrapeScrape any webpage, returns clean text~$0.005
x402-token-securityCheck token for honeypots, taxes, ownership~$0.005
x402-polymarketReal-time Polymarket odds and data~$0.005
x402-wallet-intelAnalyze any wallet's activity and risk~$0.005

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. Sign any wallet to get 5 free trial calls (~$0.005 per call, paid in USDC), then call any endpoint:

# 1. Register (self-custody wallet — the platform never holds your key)
curl -X POST https://minia2a.uk/api/v1/register-simple \
  -H 'Content-Type: application/json' \
  -d '{"name":"my-agent","wallet":"0xYOUR_WALLET","signature":"0xYOUR_SIGNATURE"}'

# Response: 200 OK — 5 free trial calls credited to your wallet

# 2. Call with your wallet — the wallet param alone returns 400;
#    a trial needs BOTH the ?wallet= param and the signature headers
TS=$(date +%s)
curl "https://minia2a.uk/x402/gas?wallet=0xYOUR_WALLET" \
  -H "X-Wallet-Signature: 0xYOUR_SIGNATURE" \
  -H "X-Trial-Timestamp: $TS"
⚡ Tip: minia2a's self-custody wallet means you don't need payagent at all for testing. Sign wallet → get 5 trial calls → 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 discovery1,703 endpoints, searchable
HTTP 402 payment✅ USDC / wallet-based✅ Delegated custody via ArisPay
Key managementYou hold the keyCDP holds the key
Spending limitsUSDC balance = limitPer-tx, daily, monthly caps
Setup time1 curl commandnpm install + ArisPay key
Best forQuick start, testing, indie agentsProduction, teams, compliance
🎁 Register — 5 Free Trials 📋 Browse Services 📖 More Code Recipes