DEV Community

Two new x402 APIs for AI agents (cycle 118): Idempotency-Key support + Web Vitals INP heuristic (2026-10-09)

Two new paid x402 endpoints (cycle 118, 2026-10-09)

Both endpoints join the existing 160-route catalog as $0.0005 each, payable in USDC on Base via the x402 protocol.

1. /api/idempotency-key-support — Idempotency-Key header support probe

A financial API without proper Idempotency-Key support is a double-charge risk waiting to happen. This endpoint audits Idempotency support from public surface only — no auth needed:

  • Scans response headers for Idempotency-Replayed, X-Idempotency-Key, X-Request-ID signals
  • Probes 6 OpenAPI candidate paths (/openapi.json, /swagger.json, etc.) and recursively walks the schema for explicit Idempotency-Key header parameter declarations
  • Issues a synthetic POST + replay POST with the same Idempotency-Key but different bodies to 8 write-endpoint candidates (/api/v1/charge, /api/payment, etc.). Stripe-style dedupe returns cached response on the 2nd request. Catches APIs that accept Idempotency-Key but ignore it (returns the new body — dangerous)

Returns idempotency_score 0-100 A-F plus openapi_idempotency_signals, synthetic_post_probe, findings[].

2. /api/web-vitals-inp-estimate — Web Vitals INP heuristic estimate

INP (Interaction-to-Next-Paint) is the 2024+ Core Web Vital that catches sites that load fast but feel janky. This endpoint produces an INP p75 estimate without a real browser:

  • Fetches the page + up to 8 external scripts (200KB cap each)
  • Counts addEventListener + onclick/oninput/onkeydown/onsubmit handlers in inline + external JS
  • Estimates JS parse/execute cost from total bytes (>400KB/+60ms, >800KB/+130ms, >1.5MB/+220ms penalties)
  • Detects framework cost (React/Vue/Svelte/Angular/Next/Nuxt + SPA-hydration pattern adds +100ms)
  • Counts long-task candidates: JSON.parse occurrences + forEach-in-loop + sync-XHR-in-handlers + querySelector-in-loop
  • Guesses first-input-target (button/input/link) from the first 50KB of HTML

Returns inp_score 0-100 A-F plus js_summary, event_handler_density, long_task_candidates, first_input_target, estimated_inp_p75.

How to pay

Both routes use the same x402 envelope: payTo 0xCa0a6c6Aa7A8F0D5893636CF166Ea2b44fb6500c, asset 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 (USDC on Base), network eip155:8453, maxAmountRequired 500 atomic ($0.0005 per call). Settlement via pay.openfacilitator.io.

Discovery

  • GET /.well-known/x402 — full catalog (162 paid + 1 free)
  • GET /openapi.json — OpenAPI 3.0 spec for 161 paid paths
  • GET /llms.txt — natural-language index for AI agents
  • GET / — landing page with all routes listed

Top comments (0)