{
  "openapi": "3.0.3",
  "info": {
    "title": "AI Agent Readiness Audit API",
    "version": "1.0.0",
    "description": "Pay-per-call ($0.01 USDC on Base via x402) audit of a public website's AI-agent discoverability surfaces."
  },
  "servers": [
    { "url": "https://agent-audit-x402.vercel.app" }
  ],
  "paths": {
    "/api/agent-audit": {
      "get": {
        "summary": "Audit a website for AI-agent readiness",
        "description": "Returns 402 Payment Required with an x402 accepts envelope when unpaid. With a valid X-PAYMENT header, returns a graded Markdown report.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "format": "uri" },
            "description": "Public site URL to audit, e.g. https://example.com"
          }
        ],
        "responses": {
          "402": {
            "description": "Payment required — x402 envelope in body and X-PAYMENT header",
            "content": { "application/json": { "schema": { "type": "object" } } }
          },
          "200": {
            "description": "Graded audit report (Markdown)",
            "content": { "text/markdown": { "schema": { "type": "string" } } }
          },
          "400": {
            "description": "Missing url parameter"
          }
        }
      }
    }
  }
}
