{
  "openapi": "3.1.0",
  "info": {
    "title": "Get AI Agent Ready API",
    "version": "0.2.0",
    "description": "Audit a website or online store for AI agent readiness. Read-only and public: scans only fetch public pages, so retries are always safe."
  },
  "servers": [
    {
      "url": "https://getaiagentready.com/air"
    }
  ],
  "paths": {
    "/api/scan": {
      "post": {
        "operationId": "scanWebsite",
        "summary": "Audit a website for AI agent readiness (basic site, ecommerce and agent actions)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "example": "example.com"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scan result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "scannedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "score": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100
                    },
                    "grade": {
                      "type": "string",
                      "enum": [
                        "A",
                        "B",
                        "C",
                        "D",
                        "F"
                      ]
                    },
                    "checks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "weight": {
                            "type": "integer"
                          },
                          "score": {
                            "type": "integer"
                          },
                          "passed": {
                            "type": "boolean"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "fix": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "siteType": {
                      "type": "string",
                      "enum": [
                        "basic",
                        "ecommerce"
                      ]
                    },
                    "platform": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pagesChecked": {
                      "type": "integer"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "sections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "score": {
                            "type": "integer"
                          },
                          "grade": {
                            "type": "string"
                          },
                          "checks": {
                            "type": "array"
                          },
                          "manual": {
                            "type": "array"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unreachable URL"
          },
          "429": {
            "description": "Rate limited"
          },
          "500": {
            "description": "Unexpected error"
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. Audits have no side effects, so repeating a request is always safe.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Service health check",
        "responses": {
          "200": {
            "description": "OK"
          },
          "503": {
            "description": "Unavailable"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP (Model Context Protocol) endpoint, JSON-RPC over Streamable HTTP, with an audit_website tool",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          },
          "202": {
            "description": "Notification accepted"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    }
  },
  "security": []
}