minia2a SDK & Integrations

Give an agent the full catalog — 1,703 pay-per-call APIs (gas, token security, web scrape, CAPTCHA, AI, EU briefs…). No API key, no registration, no credits. A Base wallet pays per call in USDC; settlement is machine-executable over HTTP 402.

Current model (V5, 2026-09-10): every endpoint is anonymous-first → 402 with a machine-readable offer. Any signed wallet gets 5 free trial calls (no registration needed); afterwards the client pays the 402 automatically. Registration only matters if you want to publish your own service.

Official (recommended)

One-liners by language

TypeScript / JavaScript — official, auto-pay

import { createClient } from "minia2a-client";

const client = createClient(process.env.MINIA2A_PRIVATE_KEY); // your Base USDC wallet
const gas = await client.call("gas");                          // 402 handled, paid, retried
const r   = await client.call("web-scrape", { url: "https://example.com" });

Python — free trial (verified, eth-account only)

No official Python client yet (the old minia2a-py 0.1.0 pip package is deprecated — see below). For a free trial call, sign the EIP-191 message and send your wallet + 2 signature headers. No funded wallet needed:

import time, requests
from eth_account import Account
from eth_account.messages import encode_defunct

acct = Account.from_key(PRIVATE_KEY)                 # any wallet, even empty
ts = int(time.time())
msg = f"minia2a trial:{acct.address}:x402-time:{ts}" # service id keeps x402- prefix
sig = acct.sign_message(encode_defunct(text=msg)).signature.hex()

r = requests.get("https://minia2a.uk/x402/time", params={"wallet": acct.address},
    headers={"X-Wallet-Signature": "0x"+sig, "X-Trial-Timestamp": str(ts)})
print(r.status_code, r.json())                       # 200; X-Trial-Remaining: 4

To pay from Python today: call through the TS client/CLI, or send USDC straight to the service's payTo address (the amount in the 402 offer) and retry with the resulting tx hash in an X-Payment-Tx header — the platform verifies the on-chain transfer. Official Python pay client is on the roadmap.

Go — no official SDK yet; plain HTTP + go-ethereum

Trial call, verified live (fresh wallet → HTTP 200, X-Trial-Remaining: 4). Same signature scheme as Python above:

import ("encoding/hex"; "fmt"; "net/http"; "strconv"; "time"
        "github.com/ethereum/go-ethereum/accounts"; "github.com/ethereum/go-ethereum/crypto")

key, _ := crypto.HexToECDSA(trim0x(PRIVATE_KEY))
from := crypto.PubkeyToAddress(key.PublicKey)
ts := time.Now().Unix()
msg  := fmt.Sprintf("minia2a trial:%s:x402-time:%d", from.Hex(), ts)
sig, _ := crypto.Sign(accounts.TextHash([]byte(msg)), key); sig[64] += 27

u := "https://minia2a.uk/x402/time?wallet=" + from.Hex()
req, _ := http.NewRequest("GET", u, nil)
req.Header.Set("X-Wallet-Signature", "0x"+hex.EncodeToString(sig))
req.Header.Set("X-Trial-Timestamp", strconv.FormatInt(ts, 10))
resp, _ := http.DefaultClient.Do(req)   // 200 = free trial call

Legacy (deprecated)

Do not use for new code: the self-hosted sdk/minia2a.js still implements the pre-V5 flow (auto-generated wallets, register for credits). That flow no longer exists server-side — use minia2a-client (npm) for JS/TS instead. The minia2a-py 0.1.0 pip package is likewise deprecated; current Python guidance is on python.html.

Protocol: Pay with x402 · Task index: llms-tasks.txt · Catalog: /api/services · home