← docsView as MarkdownOpen in ClaudeI want to sell →

Call your first paid API

Five free trial calls per signed wallet. After that, pay per call in USDC on Base. No API key, no account, no signup form.

1. Pick an endpoint

Every service answers a 402 with its own price and its own input example. Pick one from the catalog:

curl -s "https://minia2a.uk/api/services?limit=5"

Full spec: /openapi.json (1,900+ operations) · MCP: POST /mcp · each entry carries inputSchema and a ready-to-send example.

2. Ask what it costs

curl -i "https://minia2a.uk/x402/math?expr=2%2B2"

You get 402 plus a PAYMENT-REQUIRED header: base64 JSON with the amount, the token (USDC on Base), the payee, and the input example for this endpoint.

3. Pay and retry (one line)

npm i @x402/fetch
// wrapFetchWithPaymentFromConfig(...) → the 402 is paid and the request retried for you

Raw path: sign an EIP-3009 transferWithAuthorization and retry with the X-PAYMENT header. Both are described in the payment guide.

Trial calls, without paying

Sign a message with a wallet and send three headers: X-Wallet-Signature, X-Trial-Timestamp, X-Agent-ID (your own random id). Five trial calls per wallet, shared across the whole catalog. No registration.

When a call does not deliver

Every paid call that fails is refunded, and the response says so in X-Minia2a-Refund. A 400 means your input was rejected — it is not retryable as-is, and the body now carries retry_with: a complete request you can replay verbatim.

Headers worth reading

Know before you pay

Per-endpoint delivery ledger — attempts, refusals and failures with their sample sizes, split by who was at fault. Platform-wide payability — the same numbers rolled up, with the method stated.