x402-monetized AI microservices — embedding, summarization, and inference endpoints with on-chain USDC payments via the x402 protocol
x402ai is an early-stage project in the AI payments / x402 ecosystem. It currently has 0 GitHub stars and 0 forks.
AI microservices monetized via the x402 payment protocol — pay-per-request with on-chain USDC, no accounts, no API keys, no KYC.
Live at api.x402ai.dev · Base mainnet
x402ai exposes a set of AI inference endpoints behind a native HTTP 402 payment wall. Each request is individually priced and settled on-chain via EIP-3009 token authorization. The service is self-hosted on a home server and served publicly through a Cloudflare Zero Trust tunnel.
Pricing is fixed per endpoint. Live prices are always available at GET /health.
| Method | Path | Model | Price | Latency (warm) | Description |
|---|---|---|---|---|---|
POST |
/api/embed |
nomic-embed-text |
$0.01 | ~370ms | Text embedding — 768-dimensional vectors |
POST |
/api/summarize |
qwen3.5-nothink:2b |
$0.02 | ~8s | Text summarization |
POST |
/api/ask |
qwen3.5-nothink:2b |
$0.04 | ~7s | Single-turn Q&A |
GET |
/health |
— | free | — | Service status and live pricing |
x402ai implements the x402 protocol over standard HTTP. No wallet registration or pre-authorization required.
Client Server Facilitator (Coinbase CDP)
│ │ │
│ POST /api/embed │ │
│ ─────────────────────────────►│ │
│ │ │
│ 402 Payment Required │ │
│ X-Payment-Details: { price, │ │
│ network, recipient, ... } │ │
│◄─────────────────────────────-│ │
│ │ │
│ [client signs EIP-3009 │ │
│ transferWithAuthorization] │ │
│ │ │
│ POST /api/embed │ │
│ X-Payment: <signed payload> │ │
│ ─────────────────────────────►│ │
│ │ verify + settle on-chain │
│ │ ──────────────────────────────────►│
│ │ │
│ │ settlement confirmed │
│ │◄───────────────────────────────────│
│ │ │
│ 200 OK + inference result │ │
│◄──────────────────────────────│ │
Key properties:
┌─────────────────────────────────────┐
│ api.x402ai.dev │
│ Cloudflare Zero Trust Tunnel │
└──────────────────┬──────────────────┘
│ HTTPS
┌──────────────────▼──────────────────┐
│ Hono (Node.js) │
│ x402-hono middleware │
│ │
│ /api/embed → Ollama │
│ /api/summarize → Ollama │
│ /api/ask → Ollama │
│ /health → status + pricing │
└──────────────────┬──────────────────┘
│
┌──────────────────▼──────────────────┐
│ Ollama │
│ nomic-embed-text (768-dim) │
│ qwen3.5-nothink:2b │
└─────────────────────────────────────┘
Hardware: Dell Precision, Intel i7-6700
Payment settlement runs on Base mainnet via the Coinbase CDP facilitator.
| Component | Role |
|---|---|
| Hono | HTTP framework |
| x402-hono | 402 payment middleware |
| Ollama | Local model inference runtime |
nomic-embed-text |
Text embedding model |
qwen3.5-nothink:2b |
Text generation model |
| Coinbase CDP | On-chain payment facilitator |
| Base | EVM L2 mainnet (USDC) |
| Cloudflare Zero Trust | Tunnel + edge security |
HTTP 402 ("Payment Required") has been reserved since 1996 but never standardized. The x402 protocol finally makes it practical: a server returns a 402 with machine-readable payment instructions, the client signs an EIP-3009 authorization over the exact amount, and a facilitator settles it on-chain. The server only processes the request after settlement is confirmed.
The result is a fully permissionless API economy — no OAuth, no billing dashboards, no rate-limit tiers. Just sign and pay.
MIT
Your AI trading terminal assistant for US stocks, commodities, forex, and crypto.
The agent-native LLM router for OpenClaw. 41+ models, <1ms routing, USDC payments on Base & Solana via x402.
A payments protocol for the internet. Built on HTTP.
A local-first AI agent with persistent memory, emotional intelligence, and a peer-to-peer skills economy.
The AI agent with a wallet — spends USDC autonomously to get real work done. Apache-2.0, TypeScript.
Daydreams is a set of tools for building agents for commerce