HTTP/1.1 402 PAYMENT REQUIRED agent402.base.eth · BASE · SOLANA · POLYGON · ARBITRUM · MONAD · CELO · AVALANCHE · SEI · OPTIMISM · STELLAR · ALGORAND · ROBINHOOD · USDC · USDG
Agent402 / tools / skill-a11y-audit

Skill: WCAG accessibility audit

FREE with proof-of-work · or $0.050 in USDC · POST /api/skill/a11y-audit

Bundled execution of the WCAG accessibility audit workflow - Run a deterministic WCAG 2.x audit of an HTML page from a string and a fg/bg color pair. Checks language attribute (3.1.1), document title (2.4.2), heading order (1.3.1), link-text presence (2.4.4), color contrast (1.4.3), and reading grade level (3.1.5 AAA). Seven pure-CPU tools, no headless browser needed - the canonical accessibility-first-pass workflow done as a single round-trip of tool calls. One x402 payment runs 7 underlying tools (html-meta, html-strip, html-links, html-select, color-contrast, readability, text-stats); partial-success per step.

Input

FieldTypeDescription
html *stringthe HTML document to audit (full document or fragment, as a string)
foreground *stringthe canonical body text color as a hex string (e.g. '#333333')
background *stringthe canonical body background color as a hex string (e.g. '#ffffff')

Example output

{
  "pack": "a11y-audit",
  "args": {
    "html": "<!doctype html><html lang=\"en\"><head><title>Quarterly Earnings Brief</title><meta name=\"viewport\" content=\"width=device-width\"></head><body><h1>Q4 Earnings Summary</h1><h3>Revenue</h3><p>Total revenue was $4.2M, up 18% year-over-year. The increase was driven primarily by enterprise SaaS contracts and a one-time licensing arrangement.</p><h2>Costs</h2><p>Operating costs grew 12% to $2.9M. Headcount expansion in engineering accounted for the majority of the increase.</p><p>Read the <a href=\"/full-report\">full report</a> or <a href=\"https://investor.example.com\">visit investor relations</a>. Click <a href=\"/contact\">here</a> for questions.</p></body></html>",
    "foreground": "#333333",
    "background": "#ffffff"
  },
  "steps": [
    {
      "slug": "html-meta",
      "ok": true,
      "result": {}
    },
    {
      "slug": "html-strip",
      "ok": true,
      "result": {}
    },
    {
      "slug": "html-links",
      "ok": true,
      "result": {}
    },
    {
      "slug": "html-select",
      "ok": true,
      "result": {}
    },
    {
      "slug": "color-contrast",
      "ok": true,
      "result": {}
    },
    {
      "slug": "readability",
      "ok": true,
      "result": {}
    },
    {
      "slug": "text-stats",
      "ok": true,
      "result": {}
    }
  ],
  "summary": "7/7 steps succeeded"
}

Try it - see the 402 challenge (free)

curl -i -X POST https://agent402.tools/api/skill/a11y-audit \
  -H "Content-Type: application/json" \
  -d '{"html":"<!doctype html><html lang=\"en\"><head><title>Quarterly Earnings Brief</title><meta name=\"viewport\" content=\"width=device-width\"></head><body><h1>Q4 Earnings Summary</h1><h3>Revenue</h3><p>Total revenue was $4.2M, up 18% year-over-year. The increase was driven primarily by enterprise SaaS contracts and a one-time licensing arrangement.</p><h2>Costs</h2><p>Operating costs grew 12% to $2.9M. Headcount expansion in engineering accounted for the majority of the increase.</p><p>Read the <a href=\"/full-report\">full report</a> or <a href=\"https://investor.example.com\">visit investor relations</a>. Click <a href=\"/contact\">here</a> for questions.</p></body></html>","foreground":"#333333","background":"#ffffff"}'

The response is HTTP 402 Payment Required with exact payment requirements. Any x402 v2 client pays automatically and retries:

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/skill/a11y-audit", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "html": "<!doctype html><html lang=\"en\"><head><title>Quarterly Earnings Brief</title><meta name=\"viewport\" content=\"width=device-width\"></head><body><h1>Q4 Earnings Summary</h1><h3>Revenue</h3><p>Total revenue was $4.2M, up 18% year-over-year. The increase was driven primarily by enterprise SaaS contracts and a one-time licensing arrangement.</p><h2>Costs</h2><p>Operating costs grew 12% to $2.9M. Headcount expansion in engineering accounted for the majority of the increase.</p><p>Read the <a href=\"/full-report\">full report</a> or <a href=\"https://investor.example.com\">visit investor relations</a>. Click <a href=\"/contact\">here</a> for questions.</p></body></html>",
    "foreground": "#333333",
    "background": "#ffffff"
  }),
});

No wallet? Pay with compute

This is a pure-CPU tool, so an agent without a wallet can pay with proof-of-work instead of USDC: fetch a challenge, solve the sha256 puzzle (16 leading zero bits - a fraction of a second of CPU, no money, no AI tokens), and resend with the X-Pow-Solution header.

import { createHash } from "node:crypto";
const lz = (b) => { let t = 0; for (const x of b) { if (!x) { t += 8; continue; } t += Math.clz32(x) - 24; break; } return t; };
const c = await (await fetch("https://agent402.tools/api/pow/challenge?slug=skill-a11y-audit")).json();
let n = 0;
while (lz(createHash("sha256").update(c.challenge + ":" + n).digest()) < c.difficulty) n++;
await fetch("https://agent402.tools/api/skill/a11y-audit", { method: "POST", headers: { "X-Pow-Solution": c.token + ":" + n, "Content-Type": "application/json" }, body: JSON.stringify({"html":"Quarterly Earnings Brief

Q4 Earnings Summary

Revenue

Total revenue was $4.2M, up 18% year-over-year. The increase was driven primarily by enterprise SaaS contracts and a one-time licensing arrangement.

Costs

Operating costs grew 12% to $2.9M. Headcount expansion in engineering accounted for the majority of the increase.

Read the full report or visit investor relations. Click here for questions.

","foreground":"#333333","background":"#ffffff"}) });

Related tools

Skill: Earnings deep-dive

$0.050 · POST /api/skill/earnings-deep-dive

Bundled execution of the Earnings deep-dive workflow - Everything you need before a company reports: the upcoming earnin…

Skill: Options analytics

$0.050 · POST /api/skill/options-analytics

Bundled execution of the Options analytics workflow - Price a European option on a live stock: pull the current quote, e…

Skill: Fixed-income desk

$0.050 · POST /api/skill/fixed-income-desk

Bundled execution of the Fixed-income desk workflow - Read the rate environment and price a bond in one workflow: the li…