Selling APIs to AI agents with x402: 69 endpoints, Cloudflare Workers, zero API keys
Description and use
The author built 69 API endpoints without keys using x402 and Cloudflare Workers, enabling AI agents to pay per call instantly and without registration.
Problem
AI agents need paid data and inference services without traditional API keys or signup, requiring a frictionless payment flow.
Outcome
The author successfully launched 69 endpoints across data, inference, and composite brief services within 48 hours, achieving 2k requests but no paid calls yet, demonstrating the feasibility of zero-key, pay-per-call API access for AI agents.
Workflow
- 1. Agent requests endpoint (e.g., GET /v1/fx/EUR).
- 2. Server responds 402 Payment Required with price and wallet address.
- 3. Agent signs a USDC transfer on Base and retries request with X-PAYMENT header.
- 4. Server verifies payment, returns JSON response.
- 5. Settlement occurs only after a 2xx response, ensuring no charge for failed calls.
Evidence
An AI agent needs the EUR/EGP rate. It calls GET /v1/fx/EUR. The server answers 402 Payment Required with a price ($0.01) and a wallet. The agent signs a USDC transfer on Base, retries with an X-PAYMENT header, gets JSON.
WorldData402 — 39 data endpoints: FX for 160+ currencies, historical rates, SEC company filings, EU public tenders, World Bank indicators, EU VAT validation, public holidays, geocoding, weather, air quality, earthquakes, Wikipedia, arXiv, Crossref, RDAP, DNS, npm/PyPI, barcodes. $0.01–$0.05 per call.
Inference402 — 15 endpoints on Cloudflare Workers AI: chat (small/large), structured JSON output, summarize, translate (plus an Arabic-tuned route that handles Egyptian dialect), extract, classify, sentiment, keywords, rewrite, embeddings, moderation, image description, Whisper transcription. $0.002–$0.02.
Briefs402 — 10 composite reports (company, country, market, tenders, domain due-diligence, location, research literature, product, package risk, long-document translation). It calls the other two internally and sells the finished brief for $0.10–$0.50.
- Record date: 2026-10-20T13:41:34.222Z