Pay-per-call API utilities

Micro utilities for AI agents and apps, priced per call and paid in USDC over the x402 protocol. No signup, no API keys — call an endpoint, get a 402, pay, and get your result.

Endpoints

MethodPathPriceWhat it does
POST /v1/echo $0.001 Echoes back the JSON body you send, with a server timestamp. Useful for verifying your x402 client integration end to end.
{"msg":"hello farm"}
POST /v1/pdf $0.010 Render HTML or a public web page into a pixel-perfect PDF using a headless Chrome browser. Send inline `html` (invoices, receipts, reports, tickets) or a `url` to snapshot; control paper size, orientation, margins, background graphics and scale. Returns the raw application/pdf bytes — no signup, no browser to run, pay per document.
{"html":"<html><body><h1>Invoice #1042</h1><table><tr><td>Item</td><td>$20.00</td></tr></table></body></html>","format":"A4","printBackground":true}
POST /v1/screenshot $0.008 Capture a screenshot of any public web page with a headless Chrome browser. Set the viewport, grab the full scrollable page or just the fold, and choose PNG, JPEG or WebP with an optional quality. Returns the raw image bytes — ideal for link previews, thumbnails, visual monitoring and archiving. No browser to run, pay per capture.
{"url":"https://example.com","fullPage":true,"format":"png"}
POST /v1/og-image $0.003 Generate a polished Open Graph / social share image (PNG) from text — no browser, no design tools. Pick a template (article, product, stat), pass a title and optional subtitle, set your brand accent colour and light/dark theme, and get back a crisp 1200×630 PNG ready for og:image, Twitter cards, blog headers and launch posts. Rendered with Satori + resvg; fast and cheap.
{"template":"article","title":"Announcing the Monetization Gateway","subtitle":"Charge for any resource behind Cloudflare via x402","accent":"#2FBF71","theme":"dark"}

How to pay (the 402 flow)

# 1. Call it — get HTTP 402 with price + asset + network in the PAYMENT-REQUIRED header
curl -i -X POST https://staging.402utils.com/v1/echo \
  -H 'content-type: application/json' \
  -d '{"msg":"hello farm"}'

# 2. Pay with any x402 client (signs a gasless USDC authorization; the
#    facilitator settles on-chain) and it retries automatically:
#    npx x402 fetch https://staging.402utils.com/v1/echo  —  or @x402/fetch in code.