{
  "openapi": "3.1.0",
  "info": {
    "title": "Rymthos Dev — Lead Intake & AI Triage API",
    "description": "API for submitting client project inquiries, AI triage, and founder notifications.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://rymthos.dev/api/lead-pipeline"
    },
    {
      "url": "https://rqiynsrdmrjdbyewecjq.supabase.co/functions/v1/lead-pipeline"
    }
  ],
  "paths": {
    "/": {
      "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)"
          }
        }
      },
      "get": {
        "summary": "Lead Pipeline Health Probe",
        "responses": {
          "200": {
            "description": "Service operational"
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Health Probe",
        "responses": {
          "200": {
            "description": "Service operational"
          }
        }
      }
    }
  }
}