{
  "openapi": "3.0.0",
  "info": {
    "title": "ZEEL AI Search Gateway API",
    "description": "API Gateway for semantic search in zeelproject.com catalog using vector database integration.",
    "version": "1.1.0"
  },
  "servers": [
    {
      "url": "https://api.zeelproject.com",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/v1/": {
      "get": {
        "summary": "Semantic search products",
        "description": "Performs a vector search query against the zeelproject.com catalog, returning matches sorted by similarity score.",
        "operationId": "searchProducts",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "The search query string (e.g., 'modern leather sofa')",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of results to return (clamped between 5 and 40)",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 5,
              "minimum": 5,
              "maximum": 40
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Language of the product titles returned in the results",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["en", "ru", "hy", "fr", "de", "it", "es", "zh"],
              "default": "en"
            }
          },
          {
            "name": "score",
            "in": "query",
            "description": "Similarity score filter threshold (0.0 to 1.0; 0.0 disables the threshold filter)",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float",
              "default": 0.0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful search response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "query": {
                      "type": "string",
                      "example": "sofa"
                    },
                    "count": {
                      "type": "integer",
                      "example": 3
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "17040"
                          },
                          "title": {
                            "type": "string",
                            "example": "Classic Sofa with Tufting and Tassels"
                          },
                          "price": {
                            "type": "integer",
                            "example": 0
                          },
                          "score": {
                            "type": "number",
                            "example": 0.30147755
                          },
                          "image": {
                            "type": "string",
                            "example": "https://zeelproject.com/uploads/posts/2021-02-02/17040_image3d.webp"
                          },
                          "url": {
                            "type": "string",
                            "example": "https://zeelproject.com/17040-classic-sofa-1.html"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing search query parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "error"
                    },
                    "message": {
                      "type": "string",
                      "example": "Parameter 'q' is required. Example: /v1/?q=modern sofa"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
