{
  "openapi": "3.1.0",
  "info": {
    "title": "Rymthos Dev API Suite",
    "description": "Public APIs for automated discovery, client project inquiries, AI triage, and real-time website UI/UX diagnostics provided by Rymthos Dev (https://rymthos.dev). Founded by Md. Billal Hossain.",
    "version": "1.0.0",
    "contact": {
      "name": "Md. Billal Hossain",
      "email": "rymthos.dev@gmail.com",
      "url": "https://rymthos.dev"
    }
  },
  "servers": [
    {
      "url": "https://rymthos.dev",
      "description": "Production Edge Gateway"
    },
    {
      "url": "https://rqiynsrdmrjdbyewecjq.supabase.co/functions/v1",
      "description": "Direct Supabase Edge Runtime"
    }
  ],
  "paths": {
    "/.well-known/api-catalog": {
      "get": {
        "summary": "RFC 9727 API Catalog Discovery Document",
        "description": "Returns the machine-readable RFC 9727 linkset catalog listing all available APIs.",
        "operationId": "getApiCatalog",
        "responses": {
          "200": {
            "description": "API Catalog in RFC 9264 Linkset format",
            "content": {
              "application/linkset+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "linkset": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "summary": "System Health Check",
        "description": "Returns real-time operational status for all Rymthos Dev public services.",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "Health status report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    },
                    "healthy": {
                      "type": "boolean",
                      "example": true
                    },
                    "service": {
                      "type": "string",
                      "example": "rymthos-dev"
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/lead-pipeline": {
      "post": {
        "summary": "Submit Client Project Inquiry / Lead",
        "description": "Ingests a project inquiry, executes AI triage via DeepSeek V4 Flash, records the lead in Supabase PostgreSQL, and triggers instant founder alerts.",
        "operationId": "submitLead",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "message"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 200,
                    "example": "Jane Doe"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "example": "jane@example.com"
                  },
                  "type": {
                    "type": "string",
                    "example": "Full-Stack Web App"
                  },
                  "budget": {
                    "type": "string",
                    "example": "$999 (Scale Plan)"
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 5000,
                    "example": "Need a custom Next.js SaaS with Stripe integration."
                  },
                  "source": {
                    "type": "string",
                    "example": "api"
                  },
                  "company": {
                    "type": "string",
                    "description": "Honeypot field — bots must leave blank"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead received and processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "example": true
                    },
                    "lead_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (missing required fields or invalid email)"
          },
          "429": {
            "description": "Rate limit exceeded (max 5 submissions per hour)"
          }
        }
      }
    },
    "/api/web-audit": {
      "post": {
        "summary": "Run Real-time Website UI/UX & Diagnostic Audit",
        "description": "Scans target website for performance, accessibility, SEO, security headers, mobile ergonomics, and heuristic scoring.",
        "operationId": "runWebAudit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://example.com"
                  },
                  "visitor_token": {
                    "type": "string"
                  },
                  "locale": {
                    "type": "string",
                    "example": "en"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Diagnostic audit telemetry and scoring results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "score": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100
                    },
                    "summary": {
                      "type": "string"
                    },
                    "metrics": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid or blocked domain/IP address"
          },
          "429": {
            "description": "Rate limit exceeded (2 audits per 24 hours)"
          }
        }
      }
    }
  }
}