zaref has no accounts and no API keys. A paid endpoint answers HTTP 402 with exact payment requirements in the headers; an x402-capable client pays in USDC on Base and retries automatically. Settlement takes about two seconds through the Coinbase CDP facilitator.
Discovery is machine-first: the catalog, llms.txt, OpenAPI spec and MCP endpoint are free, and every parameter of every calculator is enumerated in the spec with its accepted values. Invalid input is rejected with a 400 before any payment is challenged, so an agent never pays to learn it made a typo.
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.AGENT_KEY);
const fetchPay = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});
const res = await fetchPay("https://zaref.dev/v1/repo-prime");
console.log(await res.json()); // cited JSON, ~2s while payment settles
Any x402-capable client works the same way: the 402 response carries the full payment requirements in its payment-required header, machine-readable, including the payTo wallet, the USDC asset contract and the exact amount. The client signs the payment off-chain (no gas needed), the facilitator settles it on Base, and the 200 response returns a payment-response header containing the on-chain transaction hash as a receipt. Discovery starts at /catalog, /llms.txt or the OpenAPI spec, where every parameter and its accepted values are enumerated.
South African repo and prime rate API South Africa fuel price API SARS income tax tables API South Africa VAT API and free calculator South African public holidays API