x402 API Network

February 13, 2026 · View on GitHub

Micropayment-powered API network for AI agents. Pay per API call with USDC on Base L2.

Built with the x402 protocol — HTTP 402 Payment Required.

Live API

Base URL: https://x402.fatihai.app

Discovery:

  • GET / — Free endpoint listing
  • GET /.well-known/x402 — Machine-readable manifest
  • GET /llms.txt — AI crawler discovery
  • GET /health — Health check

Available APIs (16 endpoints)

High-Value APIs

EndpointMethodPriceDescription
/api/verify-emailPOST$0.01Email verification: syntax, MX, disposable, role-based, scoring 0-100
/api/domain-healthPOST$0.01Domain email health: MX, SPF, DKIM, DMARC analysis
/api/scrapeGET$0.01Web scraping: text, links, images, headings extraction
/api/ai-generatePOST$0.05AI content generation (Llama 3.3 70B): blog, email, social, SEO

Utility APIs

EndpointMethodPriceDescription
/api/dns-lookupGET$0.001DNS records (A, AAAA, MX, TXT, NS)
/api/whoisGET$0.005WHOIS domain information
/api/ip-infoGET$0.001IP reverse DNS and type detection
/api/qr-codeGET$0.002QR code generation (base64 PNG)
/api/url-metaGET$0.003URL metadata extraction (title, OG tags)
/api/html-to-markdownGET$0.002HTML to Markdown conversion
/api/ssl-checkGET$0.003SSL/TLS certificate details
/api/http-headersGET$0.001HTTP response headers
/api/password-strengthGET$0.001Password strength analysis
/api/text-statsGET$0.001Text word/sentence/reading time stats
/api/json-formatPOST$0.001JSON formatting and validation
/api/base64POST$0.001Base64 encode/decode

How It Works

  1. Send a request to any API endpoint
  2. Receive HTTP 402 with payment requirements in headers
  3. Sign a USDC micropayment with your wallet (Base L2)
  4. Resend request with PAYMENT-SIGNATURE header
  5. Receive API response

Payment Details

  • Network: Base Mainnet (EIP-155:8453)
  • Currency: USDC
  • Facilitator: Coinbase CDP
  • Gas fees: ~$0.0001 per transaction

Quick Start

For AI Agents (x402 client)

import { x402Client } from '@x402/core/client';

const client = new x402Client({
  privateKey: '0xYourPrivateKey',
  network: 'eip155:8453',
});

const result = await client.get('https://x402.fatihai.app/api/dns-lookup?domain=google.com');
console.log(result);

MCP Integration (Claude Desktop)

See claude-desktop-config.example.json for Claude Desktop MCP integration.

Direct curl (free mode / development)

# Email verification
curl -X POST https://x402.fatihai.app/api/verify-email \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com"}'

# AI content generation
curl -X POST https://x402.fatihai.app/api/ai-generate \
  -H "Content-Type: application/json" \
  -d '{"topic":"AI micropayments","type":"blog_post"}'

# Web scraping
curl "https://x402.fatihai.app/api/scrape?url=https://example.com"

Self-Hosting

git clone https://github.com/user/x402-api-network.git
cd x402-api-network
npm install
cp .env.example .env  # Configure wallet and CDP keys
npm start

Environment Variables

VariableDescription
PORTServer port (default: 4021)
WALLET_ADDRESSYour EVM wallet address (receives payments)
WALLET_PRIVATE_KEYWallet private key
CDP_API_KEY_IDCoinbase Developer Platform API key ID
CDP_API_KEY_SECRETCDP API key secret
NETWORKChain ID (default: eip155:8453 for Base)
GROQ_API_KEYGroq API key for AI content generation

Architecture

x402 API Network
├── server.js            # Express server + x402 middleware + 16 API handlers
├── mcp-server.js        # MCP server for Claude Desktop integration
├── .well-known/x402     # Machine-readable discovery manifest
├── /llms.txt            # AI crawler discovery
└── /health              # Health check endpoint

Discovery

This API is discoverable via:

  • x402 Bazaar — CDP facilitator's /discovery/resources endpoint
  • .well-known/x402 — Standard machine-readable manifest
  • llms.txt — AI search engine optimization
  • DNS TXT_x402.x402.fatihai.app discovery record
  • MCP — Model Context Protocol server for Claude/ChatGPT

License

MIT