Paid SMS endpoints, enforced by 402.
Dial x402 is a minimal paywall primitive for route handlers: if a request isn’t paid, return 402 with the action + price. If it is, send the message and record a receipt.
POST /api/v1/messages/sendPAYMENT-SIGNATURE returns 402 + a PAYMENT-REQUIRED offer.How it works
The same flow every time: learn price, pay, retry.
Unpaid requests get 402 with aPAYMENT-REQUIRED offer describing accepted payment options.
Send SMS to any phone number worldwide. Pay $0.01 USDC, get delivery confirmation. Next: provision numbers, inbound webhooks.
Record request + payment receipt in Postgres (Drizzle). Upgrade from a stub header to verified x402 later.
Key features
Small pieces that map cleanly to production.
Clients can discover pricing and retry with payment—no sessions, no API keys, no onboarding funnel.
Keep provider logic isolated behind a thin adapter. Swap providers later without rewriting your API surface.
Turbo + pnpm workspaces. Small packages, clean boundaries, fast iteration.
Next.js app router API routes, ready for Vercel. Add Postgres and webhooks when you need them.
Paid primitives
Same contract for everything: get a priced 402, pay, retry, receive a receipt.
action: "send_sms"Send text messages to any phone number worldwide for $0.01 USDC per message. The paywall contract stays the same.
action: "buy_number"Provision numbers via provider backends with x402 gating and a clean purchase receipt.
action: "order_esim"Guest checkout vibes: priced 402 → pay → receive activation/QR codes. Inspired by flows like Crypton’s guest eSIM API.
action: "start_verification"Pay per verification / rental with receipts, webhooks, and pagination-friendly list responses.
Quickstart
Try the endpoint. Get a priced 402. Retry with payment.