{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/buildonto-dev/json-schema/buildonto-dev-score-response-schema.json",
  "title": "ScoreResponse",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/buildonto-dev-openapi.yaml#/components/schemas/ScoreResponse",
  "type": "object",
  "required": [
    "status",
    "url",
    "aio_score",
    "grade",
    "hallucination_risk",
    "insights",
    "penalties",
    "benefits",
    "recommendations",
    "stats",
    "bot_preview"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "success"
      ]
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "aio_score": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 100,
      "description": "0–100 subtractive accuracy score. See `/concepts/aio-score` for the model. Null for PDF and plain-text URLs."
    },
    "grade": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "Excellent",
        "Good",
        "Needs work",
        "AI-hostile",
        "Invisible",
        null
      ]
    },
    "hallucination_risk": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "low",
        "medium",
        "high",
        null
      ]
    },
    "insights": {
      "$ref": "#/$defs/ScoringInsights"
    },
    "penalties": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Human-readable list of penalties applied to the score."
    },
    "benefits": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Positive signals detected on the page."
    },
    "recommendations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Recommendation"
      }
    },
    "stats": {
      "type": "object",
      "properties": {
        "raw_size": {
          "type": "string",
          "description": "Human-readable original HTML size (e.g. `\"412KB\"`)."
        },
        "efficiency": {
          "type": "string",
          "description": "Human-readable signal-to-noise ratio (e.g. `\"94.2%\"`)."
        },
        "extraction_time_ms": {
          "type": "integer"
        }
      }
    },
    "bot_preview": {
      "type": "string",
      "description": "Auto-generated Markdown preview with normalized heading hierarchy."
    },
    "note": {
      "type": "string",
      "description": "Sent only for PDF and plain-text URLs, to explain why the score fields are null."
    }
  },
  "$defs": {
    "Recommendation": {
      "type": "object",
      "required": [
        "title",
        "description",
        "priority"
      ],
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "priority": {
          "type": "string",
          "enum": [
            "High",
            "Medium",
            "Low"
          ]
        }
      }
    },
    "ScoringInsights": {
      "type": "object",
      "required": [
        "robots_allowed",
        "waf_blocked",
        "markdown_supported",
        "json_ld_present",
        "semantic_hierarchy"
      ],
      "properties": {
        "robots_allowed": {
          "type": "boolean"
        },
        "waf_blocked": {
          "type": "boolean"
        },
        "markdown_supported": {
          "type": "boolean"
        },
        "json_ld_present": {
          "type": "boolean"
        },
        "semantic_hierarchy": {
          "type": "boolean"
        }
      }
    }
  }
}