payagent + minia2a
Discovery meets payment. minia2a finds the x402 APIs. payagent pays them. Your agent code stays clean.
ARCHITECTURE
TypeScript / Python
Discover services
Pay HTTP 402
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:
- minia2a — 1,703 x402-wrapped services, discoverable via API
- payagent — npm package that handles HTTP 402 payment automatically
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:
| Endpoint | What it does | Cost |
|---|---|---|
x402-gas | Live gas prices (ETH, Base, Arbitrum) | ~$0.005 |
x402-web-scrape | Scrape any webpage, returns clean text | ~$0.005 |
x402-token-security | Check token for honeypots, taxes, ownership | ~$0.005 |
x402-polymarket | Real-time Polymarket odds and data | ~$0.005 |
x402-wallet-intel | Analyze 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
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"
minia2a vs. payagent — what each does
| minia2a | payagent | |
|---|---|---|
| Service discovery | ✅ 1,703 endpoints, searchable | ❌ |
| HTTP 402 payment | ✅ USDC / wallet-based | ✅ Delegated custody via ArisPay |
| Key management | You hold the key | CDP holds the key |
| Spending limits | USDC balance = limit | Per-tx, daily, monthly caps |
| Setup time | 1 curl command | npm install + ArisPay key |
| Best for | Quick start, testing, indie agents | Production, teams, compliance |