Agent Payment Demo LIVE

Watch step by step how an AI agent discovers a service, handles HTTP 402 Payment Required, pays USDC on Base L2, and receives the result — all autonomously, no human in the loop.

1 Agent discovers a service

An AI agent needs the current UTC time. It looks it up in the minia2a catalog:

# Agent searches the marketplace
curl https://minia2a.uk/api/services | jq '.services[] | select(.id=="x402-time")'

{
"id": "x402-time",
"name": "Time",
"endpoint": "https://minia2a.uk/x402/time",
"priceCents": 10,
"category": "utility"
}
2 Agent calls the service — gets HTTP 402

The agent sends a request. The server responds with HTTP 402 Payment Required — the x402 protocol in action:

# Agent makes the API call
curl https://minia2a.uk/x402/time

HTTP/1.1 402 Payment Required
payment-required: eyJhY2NlcHRzIjpbeyJhbW91bnQiOiIxMDAwMDAi... (base64)

{
"accepts": [{
"scheme": "exact",
"network": "eip155:8453", // Base mainnet
"amount": "100000", // USDC, 6 decimals = $0.10
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"payTo": "0xAb62452b4b019bC4402BFfCca6C706d16d72A7Bf",
"maxTimeoutSeconds": 120
}],
"error": "Payment required"
}

💡 This is the core innovation. Instead of registering for API keys, the agent reads the 402 response, extracts the payment details, and pays autonomously.

3 Agent pays USDC on Base L2

The agent constructs an on-chain USDC transfer on Base L2 (or uses the x402 SDK):

# Agent executes USDC transfer on Base
# Using ethers.js / viem / x402 SDK:

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', client: new ExactEvmScheme(account) }],
});

// Under the hood:
// 1. Sends request → gets 402 + the offer in `payment-required`
// 2. Signs the offer (EIP-712 / EIP-3009) — no separate transfer step
// 3. Resends with PAYMENT-SIGNATURE → server settles, returns the result

const res = await fetchWithPayment('https://minia2a.uk/x402/time');
console.log(await res.json());
4 Agent receives the result

Once payment is verified on-chain, the server processes the request and returns the result. No API key. No signup. No KYC. Just USDC.

HTTP/1.1 200 OK
x-minia2a-receipt: rcpt_1a09702b413_5b52edba9267c84f

{
"ok": true,
"utc": "2026-09-12T19:05:31.921Z",
"unix": 1789239931,
"iso": "2026-09-12T19:05:31.921Z",
"timezone": "UTC"
}

What Just Happened?

🔍 Discovery

Agent found the service by describing what it needed — no API docs required. Natural language search across 1,673 services.

💳 Autonomous Payment

No human clicked "Pay". The agent read the 402 response, constructed the USDC transfer, and paid on Base L2. 2-second settlement, sub-cent gas.

🔐 No Secrets

No API keys to provision, rotate, or leak. The agent's wallet signature is its identity. Cryptographic, not credential-based.

📊 Verifiable

Every payment is an on-chain USDC transfer. Auditable. Irreversible. No chargebacks, no fraud — just math.

Popular x402 Services (from live data)

Loading...

Each of these works the same way: curl → 402 → pay USDC → result. No API keys needed for any of them.

Get Started → Read the Quickstart