Build x402 Tools
Turn any API into a pay-per-use service in minutes. Our SDK handles payments, verification, and analytics.
1
Create Worker
Start with our Cloudflare Worker template. Zero infrastructure to manage.
2
Add Your Logic
Implement your tool's functionality. Any AI model, API, or computation.
3
Set Pricing
Define your price per request. Receive USDC directly to your wallet.
4
Deploy
One command deploys globally. AI agents can start using immediately.
Quick Start
// x402 tool with Cloudflare Workers import { Hono } from 'hono'; const app = new Hono(); // Price: $0.05 per request const PRICE_USDC = 50000; // micro-units app.post('/api/my-tool', async (c) => { // Check for payment receipt const receipt = c.req.header('X-Payment-Receipt'); if (!receipt) { // Return 402 with payment requirements return c.json({ x402Version: 1, accepts: [{ scheme: 'exact', network: 'base', maxAmountRequired: PRICE_USDC.toString(), asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC payTo: 'YOUR_WALLET_ADDRESS', }] }, 402); } // Verify payment and execute tool logic const result = await doYourToolLogic(c.req); return c.json({ success: true, result }); }); export default app;
Starter Templates
AI Text Tool
Template for AI-powered text processing tools (summarization, translation, etc.)
View TemplateData Enrichment
Template for enriching data with external APIs (lead data, company info, etc.)
View TemplateWeb Scraper
Template for paid web scraping services (SEO analysis, content extraction, etc.)
View Template