{
  "openapi": "3.1.0",
  "info": {
    "title": "Autonomy API Network",
    "version": "0.2.0",
    "description": "Payment-ready micro-APIs designed for software and AI agents.",
    "contact": {
      "name": "Autonomy API Network",
      "url": "https://autonomy-api-network.onrender.com/"
    },
    "x-guidance": "Use the paid POST endpoints for AI visibility, website, domain, developer, image, text, and data-quality tasks. Send the documented JSON body. An unpaid request returns an x402 HTTP 402 challenge. Pay the quoted USDC amount on Base mainnet, then retry the same request to receive the JSON result."
  },
  "servers": [
    {
      "url": "https://autonomy-api-network.onrender.com",
      "description": "Production"
    }
  ],
  "security": [],
  "paths": {
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Health check",
        "security": [],
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/catalog": {
      "get": {
        "operationId": "getCatalog",
        "summary": "List available tools, prices, and sample inputs",
        "security": [],
        "responses": {
          "200": {
            "description": "Endpoint catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ai-visibility-compare": {
      "post": {
        "operationId": "compareAiVisibility",
        "summary": "Compare two websites for AI-search visibility",
        "description": "Compare a primary site with a competitor for AEO, GEO, and AI-search visibility. Declares a winner, measures component gaps, and returns prioritized actions for the primary site.",
        "tags": [
          "AI Visibility"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.200000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "primaryUrl",
                  "competitorUrl"
                ],
                "properties": {
                  "primaryUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Primary public HTTP or HTTPS URL"
                  },
                  "competitorUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Competitor public HTTP or HTTPS URL"
                  }
                }
              },
              "example": {
                "primaryUrl": "https://example.com",
                "competitorUrl": "https://example.org"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Head-to-head AI visibility comparison",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiVisibilityCompareResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "413": {
            "$ref": "#/components/responses/TooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/v1/ai-visibility-audit": {
      "post": {
        "operationId": "auditAiVisibility",
        "summary": "Audit website visibility in AI search",
        "description": "Run an AEO, GEO, and AI SEO audit for ChatGPT and answer-engine visibility, including AI crawler access, llms.txt, structured entity signals, answerability, freshness, and prioritized remediation.",
        "tags": [
          "AI Visibility"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.100000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public HTTP or HTTPS URL"
                  }
                }
              },
              "example": {
                "url": "https://example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI visibility audit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiVisibilityResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "413": {
            "$ref": "#/components/responses/TooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/v1/website-intelligence": {
      "post": {
        "operationId": "inspectWebsite",
        "summary": "Generate a premium website intelligence report",
        "description": "Audit website trust, technical SEO, security, and AI readiness with availability, performance, TLS, DNS, robots.txt, sitemap, llms.txt, structured data, answerability, freshness, and prioritized issues.",
        "tags": [
          "Website Intelligence"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.025000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public HTTP or HTTPS URL"
                  }
                }
              },
              "example": {
                "url": "https://example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Website intelligence report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebsiteIntelligenceResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "413": {
            "$ref": "#/components/responses/TooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/v1/dns-snapshot": {
      "post": {
        "operationId": "inspectDnsSnapshot",
        "summary": "Inspect DNS and email-security records",
        "description": "Get a fast, low-cost snapshot of A, AAAA, MX, NS, CNAME, TXT, SPF, and DMARC records with a health score, lookup errors, and risk flags.",
        "tags": [
          "Domains"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string",
                    "maxLength": 253,
                    "description": "Public DNS hostname without a URL path"
                  }
                }
              },
              "example": {
                "domain": "example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "DNS and email-security snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnsSnapshotResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/v1/url-audit": {
      "post": {
        "operationId": "auditUrl",
        "summary": "Audit a public URL",
        "description": "Run a low-cost URL health and technical SEO audit for status, redirects, response time, metadata, caching, indexability signals, and common security headers.",
        "tags": [
          "Website"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              },
              "example": {
                "url": "https://example.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "URL audit result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UrlAuditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "413": {
            "$ref": "#/components/responses/TooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/v1/json-repair": {
      "post": {
        "operationId": "repairJson",
        "summary": "Repair malformed JSON",
        "description": "Repair malformed JSON from agents, tools, logs, or LLM output and optionally validate the repaired value against JSON Schema.",
        "tags": [
          "Developer Tools"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 250000
                  },
                  "schema": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "example": {
                "text": "{name: 'Ada', active: true,}"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Repaired JSON and optional schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRepairResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/v1/csv-inspect": {
      "post": {
        "operationId": "inspectCsv",
        "summary": "Inspect CSV data",
        "description": "Inspect CSV data quality with schema inference, column types, missing values, duplicate rows, malformed rows, and sample records.",
        "tags": [
          "Data"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "csv"
                ],
                "properties": {
                  "csv": {
                    "type": "string",
                    "maxLength": 500000
                  },
                  "delimiter": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1
                  }
                }
              },
              "example": {
                "csv": "name,age\nAda,36\nGrace,40"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CSV shape and quality report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CsvInspectResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/v1/image-inspect": {
      "post": {
        "operationId": "inspectImage",
        "summary": "Inspect a base64 image",
        "description": "Inspect a base64 image for format, dimensions, byte size, likely animation, and web optimization advice without third-party storage.",
        "tags": [
          "Images"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "base64"
                ],
                "properties": {
                  "base64": {
                    "type": "string",
                    "description": "Base64 bytes or a data URL, up to 4 MB decoded"
                  }
                }
              },
              "example": {
                "base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB..."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image metadata and optimization suggestions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageInspectResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "413": {
            "$ref": "#/components/responses/TooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/v1/text-diff": {
      "post": {
        "operationId": "diffText",
        "summary": "Compare two text or HTML snapshots",
        "description": "Compare text or HTML snapshots for content monitoring and return grouped additions, removals, unchanged lines, and similarity.",
        "tags": [
          "Text"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "before",
                  "after"
                ],
                "properties": {
                  "before": {
                    "type": "string",
                    "maxLength": 300000
                  },
                  "after": {
                    "type": "string",
                    "maxLength": 300000
                  }
                }
              },
              "example": {
                "before": "Price: $10",
                "after": "Price: $12"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Line-level difference report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextDiffResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AiVisibilityCompareResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/AiVisibilityComparisonResult"
          }
        }
      },
      "AiVisibilityResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/AiVisibilityResult"
          }
        }
      },
      "WebsiteIntelligenceResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/WebsiteIntelligenceResult"
          }
        }
      },
      "DnsSnapshotResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/DnsSnapshotResult"
          }
        }
      },
      "UrlAuditResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/UrlAuditResult"
          }
        }
      },
      "JsonRepairResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/JsonRepairResult"
          }
        }
      },
      "CsvInspectResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CsvInspectionResult"
          }
        }
      },
      "ImageInspectResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ImageInspectionResult"
          }
        }
      },
      "TextDiffResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/TextDiffResult"
          }
        }
      },
      "AiVisibilityResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "generatedAt",
          "target",
          "summary",
          "aiReadiness",
          "issues"
        ],
        "properties": {
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "target": {
            "$ref": "#/components/schemas/WebsiteTarget"
          },
          "summary": {
            "$ref": "#/components/schemas/IntelligenceSummary"
          },
          "aiReadiness": {
            "$ref": "#/components/schemas/AiReadiness"
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntelligenceIssue"
            }
          }
        }
      },
      "AiVisibilityComparisonResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "generatedAt",
          "primary",
          "competitor",
          "verdict",
          "components",
          "primaryAdvantages",
          "competitorAdvantages",
          "primaryPriorityActions"
        ],
        "properties": {
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "primary": {
            "$ref": "#/components/schemas/AiVisibilityComparisonSite"
          },
          "competitor": {
            "$ref": "#/components/schemas/AiVisibilityComparisonSite"
          },
          "verdict": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "winner",
              "winnerUrl",
              "scoreGap",
              "headline"
            ],
            "properties": {
              "winner": {
                "type": "string",
                "enum": [
                  "primary",
                  "competitor",
                  "tie"
                ]
              },
              "winnerUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "scoreGap": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "headline": {
                "type": "string"
              }
            }
          },
          "components": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "key",
                "label",
                "maximum",
                "primaryScore",
                "competitorScore",
                "gap",
                "winner"
              ],
              "properties": {
                "key": {
                  "$ref": "#/components/schemas/AiVisibilityComponentKey"
                },
                "label": {
                  "type": "string"
                },
                "maximum": {
                  "type": "integer",
                  "minimum": 0
                },
                "primaryScore": {
                  "type": "integer",
                  "minimum": 0
                },
                "competitorScore": {
                  "type": "integer",
                  "minimum": 0
                },
                "gap": {
                  "type": "integer"
                },
                "winner": {
                  "type": "string",
                  "enum": [
                    "primary",
                    "competitor",
                    "tie"
                  ]
                }
              }
            }
          },
          "primaryAdvantages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "competitorAdvantages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryPriorityActions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "priority",
                "component",
                "gapToCompetitor",
                "action"
              ],
              "properties": {
                "priority": {
                  "type": "integer",
                  "minimum": 1
                },
                "component": {
                  "$ref": "#/components/schemas/AiVisibilityComponentKey"
                },
                "gapToCompetitor": {
                  "type": "integer",
                  "minimum": 0
                },
                "action": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AiVisibilityComparisonSite": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requestedUrl",
          "finalUrl",
          "hostname",
          "overallScore",
          "overallGrade",
          "aiScore",
          "aiGrade",
          "aiLevel",
          "signals",
          "recommendations"
        ],
        "properties": {
          "requestedUrl": {
            "type": "string",
            "format": "uri"
          },
          "finalUrl": {
            "type": "string",
            "format": "uri"
          },
          "hostname": {
            "type": "string"
          },
          "overallScore": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "overallGrade": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D",
              "F"
            ]
          },
          "aiScore": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "aiGrade": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D",
              "F"
            ]
          },
          "aiLevel": {
            "type": "string",
            "enum": [
              "strong",
              "developing",
              "weak"
            ]
          },
          "signals": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "allowedCrawlerCount",
              "blockedCrawlerCount",
              "hasLlmsTxt",
              "hasStructuredData",
              "structuredDataTypes",
              "hasFreshnessSignal"
            ],
            "properties": {
              "allowedCrawlerCount": {
                "type": "integer",
                "minimum": 0
              },
              "blockedCrawlerCount": {
                "type": "integer",
                "minimum": 0
              },
              "hasLlmsTxt": {
                "type": "boolean"
              },
              "hasStructuredData": {
                "type": "boolean"
              },
              "structuredDataTypes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "hasFreshnessSignal": {
                "type": "boolean"
              }
            }
          },
          "recommendations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AiVisibilityComponentKey": {
        "type": "string",
        "enum": [
          "crawlAccess",
          "machineReadable",
          "entitySignals",
          "answerability",
          "freshness"
        ]
      },
      "WebsiteIntelligenceResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "generatedAt",
          "target",
          "summary",
          "scores",
          "audit",
          "dns",
          "tls",
          "discovery",
          "aiReadiness",
          "page",
          "issues"
        ],
        "properties": {
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "target": {
            "$ref": "#/components/schemas/WebsiteTarget"
          },
          "summary": {
            "$ref": "#/components/schemas/IntelligenceSummary"
          },
          "scores": {
            "$ref": "#/components/schemas/WebsiteScores"
          },
          "audit": {
            "$ref": "#/components/schemas/UrlAuditResult"
          },
          "dns": {
            "$ref": "#/components/schemas/DnsReport"
          },
          "tls": {
            "$ref": "#/components/schemas/TlsReport"
          },
          "discovery": {
            "$ref": "#/components/schemas/DiscoveryReport"
          },
          "aiReadiness": {
            "$ref": "#/components/schemas/AiReadiness"
          },
          "page": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PageSignals"
              },
              {
                "type": "null"
              }
            ]
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntelligenceIssue"
            }
          }
        }
      },
      "DnsSnapshotResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "generatedAt",
          "domain",
          "summary",
          "records",
          "emailSecurity",
          "lookupErrors",
          "riskFlags"
        ],
        "properties": {
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "domain": {
            "type": "string"
          },
          "summary": {
            "$ref": "#/components/schemas/IntelligenceSummary"
          },
          "records": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "a",
              "aaaa",
              "mx",
              "ns",
              "cname",
              "txt"
            ],
            "properties": {
              "a": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "aaaa": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "mx": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "exchange",
                    "priority"
                  ],
                  "properties": {
                    "exchange": {
                      "type": "string"
                    },
                    "priority": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              },
              "ns": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "cname": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "txt": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "emailSecurity": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "mxConfigured",
              "spf",
              "dmarc"
            ],
            "properties": {
              "mxConfigured": {
                "type": "boolean"
              },
              "spf": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "present",
                  "records"
                ],
                "properties": {
                  "present": {
                    "type": "boolean"
                  },
                  "records": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "dmarc": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "present",
                  "policy",
                  "records"
                ],
                "properties": {
                  "present": {
                    "type": "boolean"
                  },
                  "policy": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "records": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "lookupErrors": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "recordType",
                "code"
              ],
              "properties": {
                "recordType": {
                  "type": "string",
                  "enum": [
                    "A",
                    "AAAA",
                    "MX",
                    "NS",
                    "CNAME",
                    "TXT",
                    "DMARC"
                  ]
                },
                "code": {
                  "type": "string"
                }
              }
            }
          },
          "riskFlags": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "severity",
                "code",
                "message"
              ],
              "properties": {
                "severity": {
                  "type": "string",
                  "enum": [
                    "high",
                    "medium",
                    "low"
                  ]
                },
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "WebsiteTarget": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requestedUrl",
          "finalUrl",
          "hostname",
          "protocol"
        ],
        "properties": {
          "requestedUrl": {
            "type": "string",
            "format": "uri"
          },
          "finalUrl": {
            "type": "string",
            "format": "uri"
          },
          "hostname": {
            "type": "string"
          },
          "protocol": {
            "type": "string"
          }
        }
      },
      "IntelligenceSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "score",
          "grade",
          "riskLevel",
          "headline"
        ],
        "properties": {
          "score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "grade": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D",
              "F"
            ]
          },
          "riskLevel": {
            "type": "string",
            "enum": [
              "low",
              "moderate",
              "high"
            ]
          },
          "headline": {
            "type": "string"
          }
        }
      },
      "IntelligenceIssue": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "severity",
          "category",
          "message"
        ],
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "availability",
              "performance",
              "security",
              "seo",
              "discovery",
              "ai-readiness"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "WebsiteScores": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "availability",
          "performance",
          "security",
          "seo",
          "discovery"
        ],
        "properties": {
          "availability": {
            "type": "integer",
            "minimum": 0
          },
          "performance": {
            "type": "integer",
            "minimum": 0
          },
          "security": {
            "type": "integer",
            "minimum": 0
          },
          "seo": {
            "type": "integer",
            "minimum": 0
          },
          "discovery": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "AiReadiness": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "score",
          "grade",
          "level",
          "components",
          "signals",
          "recommendations"
        ],
        "properties": {
          "score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "grade": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D",
              "F"
            ]
          },
          "level": {
            "type": "string",
            "enum": [
              "strong",
              "developing",
              "weak"
            ]
          },
          "components": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "crawlAccess",
              "machineReadable",
              "entitySignals",
              "answerability",
              "freshness"
            ],
            "properties": {
              "crawlAccess": {
                "type": "integer",
                "minimum": 0
              },
              "machineReadable": {
                "type": "integer",
                "minimum": 0
              },
              "entitySignals": {
                "type": "integer",
                "minimum": 0
              },
              "answerability": {
                "type": "integer",
                "minimum": 0
              },
              "freshness": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "signals": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "allowedCrawlers",
              "blockedCrawlers",
              "unspecifiedCrawlers",
              "hasLlmsTxt",
              "hasStructuredData",
              "structuredDataTypes",
              "hasFreshnessSignal",
              "questionHeadings"
            ],
            "properties": {
              "allowedCrawlers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "blockedCrawlers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "unspecifiedCrawlers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "hasLlmsTxt": {
                "type": "boolean"
              },
              "hasStructuredData": {
                "type": "boolean"
              },
              "structuredDataTypes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "hasFreshnessSignal": {
                "type": "boolean"
              },
              "questionHeadings": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "recommendations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UrlAuditResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requestedUrl",
          "finalUrl",
          "status",
          "statusText",
          "ok",
          "responseTimeMs",
          "redirects",
          "content",
          "headers",
          "suggestions"
        ],
        "properties": {
          "requestedUrl": {
            "type": "string",
            "format": "uri"
          },
          "finalUrl": {
            "type": "string",
            "format": "uri"
          },
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "statusText": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "responseTimeMs": {
            "type": "integer",
            "minimum": 0
          },
          "redirects": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "from",
                "to",
                "status"
              ],
              "properties": {
                "from": {
                  "type": "string",
                  "format": "uri"
                },
                "to": {
                  "type": "string",
                  "format": "uri"
                },
                "status": {
                  "type": "integer"
                }
              }
            }
          },
          "content": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "contentType",
              "contentLength",
              "title",
              "description",
              "canonical",
              "robots",
              "language"
            ],
            "properties": {
              "contentType": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "contentLength": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "title": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "canonical": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "robots": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "language": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "headers": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "server",
              "cacheControl",
              "security",
              "missingSecurityHeaders"
            ],
            "properties": {
              "server": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "cacheControl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "security": {
                "type": "object",
                "additionalProperties": {
                  "type": "boolean"
                }
              },
              "missingSecurityHeaders": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "suggestions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "DnsReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "addresses",
          "ipv4Count",
          "ipv6Count"
        ],
        "properties": {
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "address",
                "family"
              ],
              "properties": {
                "address": {
                  "type": "string"
                },
                "family": {
                  "type": "integer",
                  "enum": [
                    4,
                    6
                  ]
                }
              }
            }
          },
          "ipv4Count": {
            "type": "integer",
            "minimum": 0
          },
          "ipv6Count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "TlsReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "authorized",
          "authorizationError",
          "issuer",
          "subject",
          "validFrom",
          "validTo",
          "daysRemaining",
          "protocol",
          "error"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "authorized": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "authorizationError": {
            "type": [
              "string",
              "null"
            ]
          },
          "issuer": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "validFrom": {
            "type": [
              "string",
              "null"
            ]
          },
          "validTo": {
            "type": [
              "string",
              "null"
            ]
          },
          "daysRemaining": {
            "type": [
              "number",
              "null"
            ]
          },
          "protocol": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ResourceProbe": {
        "type": "object",
        "required": [
          "url",
          "status",
          "exists",
          "contentType",
          "bytes",
          "redirectedTo"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "exists": {
            "type": "boolean"
          },
          "contentType": {
            "type": [
              "string",
              "null"
            ]
          },
          "bytes": {
            "type": "integer",
            "minimum": 0
          },
          "redirectedTo": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DiscoveryReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "robotsTxt",
          "sitemap",
          "llmsTxt",
          "aiCrawlerPolicies"
        ],
        "properties": {
          "robotsTxt": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceProbe"
              },
              {
                "type": "object",
                "required": [
                  "disallowsAll",
                  "sitemapReferences"
                ],
                "properties": {
                  "disallowsAll": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "sitemapReferences": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            ]
          },
          "sitemap": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceProbe"
              },
              {
                "type": "object",
                "required": [
                  "urlEntries",
                  "sitemapEntries"
                ],
                "properties": {
                  "urlEntries": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "sitemapEntries": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                }
              }
            ]
          },
          "llmsTxt": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceProbe"
              },
              {
                "type": "object",
                "required": [
                  "hasMarkdownHeadings",
                  "hasLinks"
                ],
                "properties": {
                  "hasMarkdownHeadings": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "hasLinks": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                }
              }
            ]
          },
          "aiCrawlerPolicies": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "allowed",
                "blocked",
                "unspecified"
              ]
            }
          }
        }
      },
      "PageSignals": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "viewport",
          "favicon",
          "openGraph",
          "headings",
          "jsonLdBlocks",
          "jsonLdTypes",
          "publishedAt",
          "modifiedAt",
          "answerability",
          "wordCount",
          "links"
        ],
        "properties": {
          "viewport": {
            "type": [
              "string",
              "null"
            ]
          },
          "favicon": {
            "type": [
              "string",
              "null"
            ]
          },
          "openGraph": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "title",
              "description",
              "image",
              "type"
            ],
            "properties": {
              "title": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "image": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "headings": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "h1",
              "h2",
              "h3"
            ],
            "properties": {
              "h1": {
                "type": "integer",
                "minimum": 0
              },
              "h2": {
                "type": "integer",
                "minimum": 0
              },
              "h3": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "jsonLdBlocks": {
            "type": "integer",
            "minimum": 0
          },
          "jsonLdTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "modifiedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "answerability": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "questionHeadings",
              "listItems",
              "definitionTerms",
              "faqStructuredData"
            ],
            "properties": {
              "questionHeadings": {
                "type": "integer",
                "minimum": 0
              },
              "listItems": {
                "type": "integer",
                "minimum": 0
              },
              "definitionTerms": {
                "type": "integer",
                "minimum": 0
              },
              "faqStructuredData": {
                "type": "boolean"
              }
            }
          },
          "wordCount": {
            "type": "integer",
            "minimum": 0
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "total",
              "internal",
              "external",
              "invalid"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "internal": {
                "type": "integer",
                "minimum": 0
              },
              "external": {
                "type": "integer",
                "minimum": 0
              },
              "invalid": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      },
      "JsonRepairResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "repairedText",
          "value",
          "changed",
          "validAgainstSchema",
          "schemaErrors"
        ],
        "properties": {
          "repairedText": {
            "type": "string"
          },
          "value": {},
          "changed": {
            "type": "boolean"
          },
          "validAgainstSchema": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "schemaErrors": {
            "type": "array",
            "items": {}
          }
        }
      },
      "CsvInspectionResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "delimiter",
          "rowCount",
          "columnCount",
          "duplicateRows",
          "inconsistentRows",
          "columns",
          "sample"
        ],
        "properties": {
          "delimiter": {
            "type": "string"
          },
          "rowCount": {
            "type": "integer",
            "minimum": 0
          },
          "columnCount": {
            "type": "integer",
            "minimum": 0
          },
          "duplicateRows": {
            "type": "integer",
            "minimum": 0
          },
          "inconsistentRows": {
            "type": "integer",
            "minimum": 0
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "name",
                "inferredType",
                "missing",
                "unique",
                "examples"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "inferredType": {
                  "type": "string",
                  "enum": [
                    "integer",
                    "number",
                    "boolean",
                    "date",
                    "string",
                    "empty"
                  ]
                },
                "missing": {
                  "type": "integer",
                  "minimum": 0
                },
                "unique": {
                  "type": "integer",
                  "minimum": 0
                },
                "examples": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "sample": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      },
      "ImageInspectionResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "format",
          "width",
          "height",
          "megapixels",
          "inputBytes",
          "likelyAnimated",
          "suggestions"
        ],
        "properties": {
          "format": {
            "type": [
              "string",
              "null"
            ]
          },
          "width": {
            "type": [
              "number",
              "null"
            ]
          },
          "height": {
            "type": [
              "number",
              "null"
            ]
          },
          "megapixels": {
            "type": [
              "number",
              "null"
            ]
          },
          "inputBytes": {
            "type": "integer",
            "minimum": 0
          },
          "likelyAnimated": {
            "type": "boolean"
          },
          "suggestions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TextDiffResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "changed",
          "addedLines",
          "removedLines",
          "unchangedLines",
          "similarity",
          "changes"
        ],
        "properties": {
          "changed": {
            "type": "boolean"
          },
          "addedLines": {
            "type": "integer",
            "minimum": 0
          },
          "removedLines": {
            "type": "integer",
            "minimum": 0
          },
          "unchangedLines": {
            "type": "integer",
            "minimum": 0
          },
          "similarity": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "changes": {
            "type": "array",
            "description": "Grouped line changes",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "type",
                "lineCount",
                "text"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "added",
                    "removed",
                    "unchanged"
                  ]
                },
                "lineCount": {
                  "type": "integer",
                  "minimum": 1
                },
                "text": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {}
            }
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Payment Required",
        "headers": {
          "PAYMENT-REQUIRED": {
            "description": "Base64-encoded x402 v2 payment requirement",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object"
            }
          }
        }
      },
      "TooLarge": {
        "description": "Request or inspected resource exceeds a configured limit",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "Input was valid JSON but could not be processed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
