{
  "openapi": "3.1.1",
  "info": {
    "title": "AIO.GEO Public Protocol API",
    "version": "0.3.5",
    "description": "AI Search Readiness audit and executive brief. We do not sell LLM rankings. Nobody can measure them honestly. We sell what can be measured: structure, accessibility, and receipts to prove it. Public hosts only. SSRF firewall rejects private/localhost targets."
  },
  "servers": [
    {
      "url": "https://www.aiogeoprotocol.com"
    }
  ],
  "paths": {
    "/api/v1/public/audit": {
      "post": {
        "operationId": "publicAudit",
        "summary": "Run AI Search Readiness audit",
        "description": "Structural readiness scan for a public domain. Not an LLM ranking. Returns overallScore, pillars, recommendations, and briefUrl.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "Public hostname or URL such as example.com",
                    "example": "example.com"
                  },
                  "mode": {
                    "type": "string",
                    "description": "Scan depth",
                    "enum": [
                      "light",
                      "deep"
                    ],
                    "default": "light",
                    "example": "light"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when audit completed"
                    },
                    "domain": {
                      "type": "string",
                      "description": "Normalized domain"
                    },
                    "overallScore": {
                      "type": "number",
                      "description": "Readiness score 0 to 100"
                    },
                    "methodology": {
                      "type": "string",
                      "description": "Scoring methodology version"
                    },
                    "pillars": {
                      "type": "array",
                      "description": "Per-pillar structural scores",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          },
                          "summary": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "recommendations": {
                      "type": "array",
                      "description": "Plain-English fixes",
                      "items": {
                        "type": "string"
                      }
                    },
                    "briefUrl": {
                      "type": "string",
                      "description": "Link to full executive brief"
                    },
                    "cli": {
                      "type": "string",
                      "description": "CLI command hint"
                    },
                    "refusal": {
                      "type": "string",
                      "description": "Standing refusal text"
                    },
                    "error": {
                      "type": "string",
                      "description": "Error message when ok is false"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or blocked URL"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/v1/public/brief": {
      "post": {
        "operationId": "publicExecutiveBrief",
        "summary": "Generate executive brief summary",
        "description": "Dual-engine agency brief for a public domain. Structural readiness only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "Public hostname or URL",
                    "example": "example.com"
                  },
                  "agencyName": {
                    "type": "string",
                    "description": "Optional agency co-brand name",
                    "example": "AIO.GEO Partner"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Brief payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when brief generated"
                    },
                    "brief": {
                      "type": "object",
                      "description": "Executive brief document",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "clientDomain": {
                          "type": "string"
                        },
                        "agencyName": {
                          "type": "string"
                        },
                        "industryPreset": {
                          "type": "string"
                        },
                        "overallScore": {
                          "type": "number"
                        },
                        "shareUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "description": "Error message when ok is false"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    }
  }
}
