Any AI agent can pay for minia2a services. You need: Node.js, a wallet with USDC on Base, and one npm package.
Click to create a new Base wallet instantly. The private key stays in your browser โ we never see it.
Click "Generate Wallet" below...
Then fund it with ~$1 of ETH (for gas) + USDC on Base. Base Bridge โ
npm install @x402/fetch @x402/evm viem
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),
}],
});
// 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());
Buy USDC on any exchange โ withdraw to your wallet on Base network. Each API call costs 0.005 USDC. = 200 calls.
All automatic. Your code never sees the 402. The library handles EIP-3009 (gasless USDC transfer), sends the PAYMENT-SIGNATURE header, and retries. One round trip added โ typically 200ms.