Build a KYB agent in 20 lines no API key, the agent pays per call A developer built a Know Your Business (KYB) agent in ~20 lines of TypeScript that verifies French companies using a pay-per-call API without requiring an API key or account. The agent uses the x402 protocol to handle HTTP 402 Payment Required responses, signing USDC authorizations to pay $0.15 per request. The endpoint consolidates six data sources including registry identity, officers, legal announcements, filed accounts, and sanctions screening against five official lists. AI agents have a boring problem: they can't sign up for things. Every interesting API sits behind an email verification, a credit-card form and an API key — three things a headless agent can't do. I ran into this building my own agents, so I ended up building an API the other way round, and this is the 20-line version of what it makes possible. We'll build a working KYB Know Your Business agent in ~20 lines of TypeScript. It verifies any French company — identity, officers, insolvency alerts, filed financials, sanctions screening — and it pays for what it uses, per call, in USDC. No account anywhere. curl -i "https://api.sirenic.eu/v1/kyb/552032534" You get HTTP 402 Payment Required . The PAYMENT-REQUIRED header is base64 JSON: price $0.15 → 150000 atomic USDC units , the receiving address, the official USDC contract and the network Base . Nothing was charged — quotes are free. Create a throwaway wallet MetaMask works , export the private key, and fund it with a couple of dollars of USDC on Base any exchange can withdraw to Base . The exact payment scheme uses signed authorizations, so the client never pays gas — USDC is all the wallet needs. The whole tutorial costs $0.15. npm install @x402/fetch @x402/core @x402/evm viem tsx export TEST WALLET KEY=0x... js import { privateKeyToAccount } from "viem/accounts"; import { wrapFetchWithPayment } from "@x402/fetch"; import { x402Client } from "@x402/core/client"; import { registerExactEvmScheme } from "@x402/evm/exact/client"; const siren = process.argv 2 ?? "552032534"; const client = new x402Client ; registerExactEvmScheme client, { signer: privateKeyToAccount process.env.TEST WALLET KEY as 0x${string} , } ; const payingFetch = wrapFetchWithPayment fetch, client ; const kyb = await await payingFetch https://api.sirenic.eu/v1/kyb/${siren} , .json as Record