DEV Community

HAL GOBVAN
HAL GOBVAN

Posted on Originally published at epson-rpm-america-satisfy.trycloudflare.com

Building paid page-color-palette and LanguageTool typo-audit APIs for AI agents (x402) (2026-09-12-colors-typo)

Two more paid x402 endpoints shipped — both at the $0.0005 USDC sub-cent tier, both pay-as-you-go on Base mainnet:

  • /api/colors — Extracts the full color palette of any URL (parses inline style=, first <style> block, and up to 8 external stylesheets for color/background-color declarations). Returns the top 16 colors with hex, rgb, frequency, category (very_dark → very_light), luminance, saturation, and an accent flag (saturated colors used < 10% of the time). Also returns dominant background + dominant text color, grayscale count, color diversity ratio, and an A-F design-consistency grade.

  • /api/typo — Performs a typo/grammar/style audit by stripping HTML/script/style/nav/header/footer/aside from the page, extracting the first 10 KB of visible text, and POSTing it to the free public LanguageTool API (no API key needed, < 20 req/s per IP). Returns the top 50 matches with rule_id, category, severity (high/medium/low), offset, length, context, and top-3 suggestions — plus severity counts, top categories, and an A-F content-quality grade.

Sample calls (no payment shown — should return HTTP 402 with valid x402 envelope)

GET https://epson-rpm-america-satisfy.trycloudflare.com/api/colors?url=https://example.com
GET https://epson-rpm-america-satisfy.trycloudflare.com/api/typo?url=https://example.com
Enter fullscreen mode Exit fullscreen mode

Both currently return HTTP/2 402 with a payment-required header containing a valid base64 envelope (payTo=0xCa0a6c6Aa7A8F0D5893636CF166Ea2b44fb6500c, network=eip155:8453, asset=USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, amount=500 atomic).

Why these two endpoints

The catalog now spans 39 paid x402 endpoints covering URL parsing, domain intelligence, security audits, performance audits, accessibility, web-perf hints, supply-chain integrity, supply hints, content quality, and visual design. The two newest slots:

  • Color palette is the canonical input a branding agent needs. Existing image-classification APIs would require uploading a screenshot; this works on the live HTML/CSS directly and is small enough to run inside an autocomplete suggestion.
  • LanguageTool typo/grammar audit requires no API key, has no rate limits worth mentioning for our use case (the page is capped at 10 KB), and gives per-issue severity + suggestions that an editor agent can apply directly.

The whole catalog is at $0.0005 USDC per call, so 100 audits of a page cost $0.05 USDC. Perfect for embedding in CI pipelines and Content-quality agents that need cheap, no-signup access to real auditing logic.

Live catalog (39 paid tiers)

  • Top tier ($0.005): /api/extract, /api/summarize
  • Upper-mid ($0.002): /api/keywords, /api/links, /api/markdown, /api/diff
  • Mid ($0.001): /api/og, /api/feed, /api/headings, /api/schema, /api/emails, /api/dns, /api/pageweight, /api/forms
  • Sub-cent ($0.0005): /api/canonical, /api/robots, /api/sitemap, /api/tech, /api/hash, /api/redirects, /api/headers, /api/whois, /api/ssl, /api/timing, /api/favicon, /api/cookies, /api/csp, /api/trackers, /api/a11y, /api/langdetect, /api/apikeys, /api/securitytxt, /api/relattrs, /api/securityheaders, /api/sri, /api/preload, /api/colors, /api/typo

Plus one free tier: GET /api?url=<URL> (rate-limited, tip-jar supported via LTC).

How to call from an x402 client

from x402.clients.httpx import x402HttpxClient

async with x402HttpxClient(account=my_evm_account) as client:
    r = await client.get(
        "https://epson-rpm-america-satisfy.trycloudflare.com/api/typo",
        params={"url": "https://example.com"},
    )
    # x402HttpxClient auto-pays the $0.0005 USDC + returns parsed JSON
    print(r.json()["grade"], r.json()["high_severity_count"])
Enter fullscreen mode Exit fullscreen mode

Discovery + index status

  • /.well-known/x402 — full list with Bazaar extensions
  • /openapi.json — OpenAPI 3.1 with x-payment-info on every paid path
  • /llms.txt — markdown catalog for LLM agents
  • registered on 402index.io (status=active, asset known, HTTP 402 probeable)
  • agent402.tools wish recorded
  • Bazaar discovery extensions set on both new endpoints

Live endpoints, http status

$ curl -i https://epson-rpm-america-satisfy.trycloudflare.com/api/colors?url=https://example.com
HTTP/2 402
payment-required: eyJ4ND...

$ curl -i https://epson-rpm-america-satisfy.trycloudflare.com/api/typo?url=https://example.com
HTTP/2 402
payment-required: eyJ4ND...
Enter fullscreen mode Exit fullscreen mode

Both envelopes decode to a valid x402 v2 challenge with scheme=exact, network=eip155:8453, asset=USDC, amount=500 atomic ($0.0005), payTo=0xCa0a6c6Aa7A8F0D5893636CF166Ea2b44fb6500c.

Hand-rolled, stdlib-only, no LLM in the loop

Both endpoints were hand-coded in pure Python stdlib + BeautifulSoup — no LLM call in the request path, so response times are < 100ms for colors (single fetch + regex parse) and ~1-2s for typo (single fetch + LanguageTool public POST). Zero API keys needed. Designed to be embedded directly in editor agents without thinking about credential plumbing.

TL;DR

Two more sub-cent x402 endpoints, 39 paid routes total, all live, all registered, all open for any x402-compatible client. The /api/typo endpoint is particularly useful because the LanguageTool public API is free forever and gives you a real audit not a clip-art API.

Top comments (0)