{
  "openapi": "3.0.3",
  "info": {
    "title": "Site Analyzer AI Agent API",
    "description": "Programmatic Machine-to-Machine API for AI Agents to purchase and run technical SEO audits and website health checkups.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://siteanalyzerfree.com",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/api/v1/agent/checkup.php": {
      "post": {
        "summary": "Quick Technical SEO Checkup ($7 USD)",
        "description": "Runs a quick technical health checkup on any website domain. Deducts $7 USD from the agent's API balance.",
        "operationId": "runQuickCheckup",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["domain"],
                "properties": {
                  "domain": {
                    "type": "string",
                    "example": "example.com",
                    "description": "Target website domain or URL to audit."
                  },
                  "format": {
                    "type": "string",
                    "enum": ["json", "markdown"],
                    "default": "json",
                    "description": "Output format: 'json' for raw structured data or 'markdown' for LLM-formatted summaries."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SEO Checkup completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "product": { "type": "string", "example": "quick_checkup" },
                    "charged_usd": { "type": "number", "example": 7.0 },
                    "remaining_balance_usd": { "type": "number", "example": 43.0 },
                    "report_code": { "type": "string", "example": "CC15AC90" },
                    "domain": { "type": "string", "example": "example.com" },
                    "health_score": { "type": "integer", "example": 85 },
                    "scan_duration_ms": { "type": "integer", "example": 1450 },
                    "total_issues": { "type": "integer", "example": 12 },
                    "total_passes": { "type": "integer", "example": 89 },
                    "issues": { "type": "array" },
                    "passes": { "type": "array" },
                    "report_url": { "type": "string" }
                  }
                }
              }
            }
          },
          "401": { "description": "Missing or invalid Bearer API key." },
          "402": { "description": "Payment Required. Insufficient agent credit balance." }
        }
      }
    },
    "/api/v1/agent/full-audit.php": {
      "post": {
        "summary": "Deep Full SEO Audit Report ($39 USD)",
        "description": "Executes a deep, multi-page 30+ check technical SEO audit report. Deducts $39 USD from the agent's API balance.",
        "operationId": "runFullAudit",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["domain"],
                "properties": {
                  "domain": {
                    "type": "string",
                    "example": "example.com",
                    "description": "Target website domain or URL to audit."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Full SEO Audit completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "product": { "type": "string", "example": "full_audit" },
                    "charged_usd": { "type": "number", "example": 39.0 },
                    "remaining_balance_usd": { "type": "number", "example": 11.0 },
                    "report_code": { "type": "string", "example": "A92F1B01" },
                    "domain": { "type": "string", "example": "example.com" },
                    "summary_score": { "type": "integer", "example": 92 },
                    "scan_duration_ms": { "type": "integer", "example": 4500 },
                    "audit_summary": { "type": "object" },
                    "report_url": { "type": "string" }
                  }
                }
              }
            }
          },
          "401": { "description": "Missing or invalid Bearer API key." },
          "402": { "description": "Payment Required. Insufficient agent credit balance." }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API_KEY"
      }
    }
  }
}
