Your AI agent can reason, plan, and execute. But can it pay? Can it autonomously buy the data it needs — token prices, wallet intelligence, gas estimates — without a human pulling out a credit card?
With x402 and minia2a, the answer is yes. Here's how to do it in three lines of code.
Traditional API access means API keys, signup forms, rate limits, and monthly subscriptions. AI agents can't fill out signup forms. They can't pass credit checks. They can't negotiate SaaS contracts.
But they can sign a transaction.
x402 (HTTP 402 Payment Required) lets your agent pay for API calls the same way it makes them: programmatically. No human in the loop.
curl -s -X POST https://minia2a.uk/api/v1/register-simple \
-H "Content-Type: application/json" \
-d '{"name":"my-first-agent"}'
That's it. Your agent now has a self-custody wallet on Base L2, preloaded with 500 free credits (worth ~$2.50 in API calls). No KYC. No gas fees. No waiting.
curl -s "https://minia2a.uk/x402/proxy/x402-time?wallet=0xabc123..."
Your agent just paid for an API call. Credits were deducted from your balance. The response includes the data you asked for.
No API key. No subscription. No credit card. Just: agent wants data → agent pays → agent gets data.
curl -s "https://minia2a.uk/api/v1/credits?wallet=0xabc123..."
499 credits left. One call consumed. Your agent is now a paying customer of the API economy.
minia2a lists 180 x402-enabled services your agent can call right now:
| Service | What It Does | Price |
|---|---|---|
x402-time | Precise UTC timestamp | $0.001 |
x402-gas | Real-time gas prices across chains | $0.003 |
x402-token-security | Token contract audit (honeypot, tax, ownership) | $0.005 |
x402-wallet-intel | Wallet age, activity, PnL, tags | $0.005 |
x402-web-scrape | Scrape any webpage, clean output | $0.005 |
x402-ens-resolve | Resolve ENS names → addresses | $0.001 |
x402-funding-rate | Perpetual funding rates across exchanges | $0.003 |
x402-sentiment | Crypto sentiment analysis | $0.003 |
Full catalog: curl https://minia2a.uk/api/services
Here's a Python agent that researches a token before trading — it calls 3 paid APIs and pays for each:
import requests, os
WALLET = os.environ["MINIA2A_WALLET"]
BASE = "https://minia2a.uk/x402/proxy"
def call(service, **params):
params["wallet"] = WALLET
r = requests.get(f"{BASE}/{service}", params=params)
return r.json()
token = "0x1234..."
security = call("x402-token-security", token=token)
funding = call("x402-funding-rate", symbol="ETH")
sentiment = call("x402-sentiment", symbol="ETH")
print(f"Token safety: {security.get('result',{}).get('isHoneypot')}")
print(f"ETH funding: {funding.get('result',{}).get('rate')}")
print(f"ETH sentiment: {sentiment.get('result',{}).get('sentiment')}")
# Check remaining credits
r = requests.get(f"https://minia2a.uk/api/v1/credits?wallet={WALLET}")
print(f"Credits left: {r.json()['credits']}")
After 500 free calls (or when you need more), your agent hits an HTTP 402:
Your agent sends $0.005 USDC on Base → retries the request → gets the data. The whole flow takes under 2 seconds. Or use @x402/fetch (npm) which handles the 402 → pay → retry cycle automatically:
import { x402Fetch } from "@x402/fetch";
const res = await x402Fetch("https://minia2a.uk/x402/proxy/x402-gas");
const data = await res.json();
In three lines of code, you gave your AI agent:
Your agent is no longer just a reasoning engine. It's an economic actor. It earns. It spends. It decides what data is worth paying for.
minia2a is a live marketplace. 180 services. USDC on Base. Pay per call. minia2a.uk