← minia2a.uk

Pay with x402 — One Line of Code

Any AI agent can pay for minia2a services. You need: Node.js, a wallet with USDC on Base, and one npm package.

→ Using MetaMask Agent Wallet or a Cloudflare-hosted agent? Start with the Agent Wallet Guide.

🆓 New here? Get 5 free trial calls — no payment needed.

Sign a short message with any EVM wallet — no registration, no USDC. Wallet ownership is proven by signature, so the key never leaves your machine.

🎁 Get 5 Free Trials →

🔑 No Wallet Yet?

You don't need any funds — any EVM wallet (even an empty one) gets 5 free trial calls by signing a message; no registration required. See the Agent Wallet Guide.

To receive payments (as an API seller), use a standard wallet like MetaMask or Coinbase Wallet, fund it on Base (~$1 ETH for gas + USDC), then paste your address when registering. Base Bridge →

Platform fee: 5% standard (0% through 2026 — launch promotion).

Want to sell your own API on minia2a? Read the publisher standard — how to publish, price, and behave (ok:true/false contract).

Security: minia2a never generates, holds, or displays your private key. Your wallet address alone is enough to transact with us.

Step 1: Install

npm install @x402/fetch @x402/evm viem

Step 2: Copy this code

import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);

const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{
    network: "eip155:8453",  // Base mainnet
    client: new ExactEvmScheme(account),
  }],
  spendControls: false,  // 重要:禁用默认 $1/笔上限,否则付不了 $2+ 服务
});

// That"s it. All 402 responses are now handled automatically.
// Just use fetchWithPayment instead of fetch:

const res = await fetchWithPayment("https://minia2a.uk/x402/recall?q=agent economy");
console.log(await res.json());

⚠️ $1/笔支付上限:@x402 SDK 默认 spendControls.maxAmountPerPayment 为 $1。不配置的话,$2 合约审计、$20 AI 审计这类高价服务会支付失败。上面示例已加 spendControls: false(禁用上限)。

Step 3: Get USDC on Base

Fund a little USDC on Base

Buy USDC on any exchange → withdraw to your wallet on Base. Prices are per service (from ~$0.001; audit tiers run $2–$50) — check the price on each endpoint's 402 offer or in the catalog.

How it works

You call → Server returns 402 → Library pays → Retries → You get result

All automatic. Your code never sees the 402. The library signs the offer (x402 exact — an EIP-3009 authorization — in USDC on Base), sends the PAYMENT-SIGNATURE header, and retries. One round trip added — typically 200ms.

⚠️ Got a 400 instead of a 402? That is a signature problem, not a payment one

The library handles payment for you. But if you attach a wallet yourself — which is how the free trial works — you own the signature. A 400 means it did not verify, and paying will not fix it. The body names the exact string to sign.

Trial call: ?wallet=0x… plus X-Wallet-Signature = EIP-191 personal_sign over minia2a trial:<wallet>:<serviceId>:<unixSeconds>, and X-Trial-Timestamp = that same unix seconds. 5 free calls per wallet, no registration. Sign the catalog id (x402-time), not the URL slug (time) — signing the slug is the most common cause.

Telling them apart: 400 missing X-Wallet-Signature header · 400 signature does not match wallet · 400 X-Trial-Timestamp expired · 402 = pay, or your 5 trials are spent. Over MCP the same failure arrives as -32602 inside an HTTP 200, so a status-code-only client reads it as success.

Full diagnosis with real response bodies: 400 vs 402 vs -32602 →

⏳ Slow services: submit and poll instead of blocking

Some calls take a while — captcha-solve polls its upstream for up to 60s, the AI audits take seconds to tens of seconds. Add ?async=1 and the call returns 202 immediately with a job id; you collect the result when it is ready.

Submit: POST /x402/<service>?async=1 — payment or trial works exactly as usual (settled up front, same as sync) → 202 {"jobId":"…","statusUrl":"/jobs/<id>","token":"…","pollAfterMs":1000}

Collect: GET /jobs/<jobId> with header X-Job-Token: <token>, polling every pollAfterMs. status goes queued → running → done, or ends at failed (delivery failed — a paid call is refunded, a trial call gets its trial back) or rejected (upstream refused your request; httpStatus says why — fix the params and resubmit).

Limits: params ≤64KB, result ≤1MiB (over that the job fails and refunds — use the synchronous call for large responses), results expire after 24h, ≤3 in-flight trial jobs per wallet. Syncing is unchanged: without ?async=1 nothing about your call changes. Machine-readable summary: /llms-tasks.txt

Browse the catalog free →
🎁 Get 5 Free Trials — sign a wallet, no registration →

☁️ Multi-network metadata (Cloudflare, Celo, Polygon, …)

What a live call offers: the 402 challenge quotes USDC on eip155:8453 (Base) — that is the settlement rail for every call today.

What /.well-known/x402 advertises: seven network entries (base, cloudflare, celo, polygon, circle, algorand, solana), each with a facilitator. Note cloudflare and circle are chainId 8453 — they route to Base, not a separate rail; the others are listed with their own facilitators and are not necessarily offered on every endpoint.

Treat the extra networks as catalog metadata, not a per-call promise. Developer detail: CF Wallets + x402 →

🛡️ npm-audit + pip-audit — Dep Vulnerability Scanners

Only dependency scanners in the x402 ecosystem. \$0.02/scan on Base.

# npm (JavaScript/TypeScript)
curl -X POST https://minia2a.uk/x402/npm-audit \
  -H "content-type: application/json" \
  -d '{"packageJson":"{\"dependencies\":{\"lodash\":\"4.17.20\"}}"}'

# pip (Python)
curl -X POST https://minia2a.uk/x402/pip-audit \
  -H "content-type: application/json" \
  -d '{"requirements":"requests==2.28.0"}'