{
  "openapi": "3.1.0",
  "info": {
    "title": "Sirocco Cooling sizing API",
    "version": "1.0.0",
    "description": "Read-only sizing and catalogue API. No authentication, no writes, no personal data. All figures are reference configurations; the order drawing governs.",
    "contact": {
      "email": "quote@sirocco-cooling.com",
      "url": "https://sirocco-cooling.pages.dev/contact/"
    },
    "license": {
      "name": "Content copyright Sirocco Cooling Systems; API free to query",
      "identifier": "proprietary"
    }
  },
  "servers": [
    {
      "url": "https://sirocco-cooling.pages.dev"
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Service liveness and build identifier",
        "responses": {
          "200": {
            "description": "Service is up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "build": {
                      "type": "string"
                    },
                    "models": {
                      "type": "integer"
                    },
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/sizing": {
      "get": {
        "operationId": "sizeCooler",
        "summary": "Size a direct evaporative cooling installation",
        "description": "Computes wet-bulb from dry-bulb and relative humidity (Stull 2011), then airflow, model, unit count, supply temperature, pad face area, water use and relief opening. Returns 422 with a details object when a parameter is missing or outside its range; returns verdict \"not-recommended\" above 60 % RH instead of failing.",
        "parameters": [
          {
            "name": "dry_bulb_c",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": -10,
              "maximum": 60
            },
            "description": "Design dry-bulb temperature, °C."
          },
          {
            "name": "rh_percent",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Design relative humidity, percent."
          },
          {
            "name": "area_m2",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100000
            },
            "description": "Conditioned floor area, m²."
          },
          {
            "name": "height_m",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": 2,
              "maximum": 30
            },
            "description": "Average ceiling height, m."
          },
          {
            "name": "ach",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 4,
              "maximum": 80,
              "default": 20
            },
            "description": "Air changes per hour."
          },
          {
            "name": "effectiveness",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 0.7,
              "maximum": 0.95,
              "default": 0.85
            },
            "description": "Media saturation effectiveness."
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sp-09",
                "sp-18",
                "idx-30",
                "hd-45"
              ]
            },
            "description": "Force a model instead of automatic selection."
          }
        ],
        "responses": {
          "200": {
            "description": "Sizing result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "requiredAirflowM3h": {
                      "type": "number"
                    },
                    "wetBulbC": {
                      "type": "number"
                    },
                    "supplyTempC": {
                      "type": "number"
                    },
                    "unitCount": {
                      "type": "integer"
                    },
                    "model": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "airflowM3h": {
                          "type": "number"
                        },
                        "url": {
                          "type": "string"
                        }
                      }
                    },
                    "waterTotalLh": {
                      "type": "number"
                    },
                    "reliefAreaM2": {
                      "type": "number"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "recommended",
                        "marginal",
                        "not-recommended"
                      ]
                    },
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Missing or invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {
                      "type": "object"
                    },
                    "limits": {
                      "type": "object"
                    },
                    "example": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "List cooler and media products",
        "responses": {
          "200": {
            "description": "Product list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "source": {
                      "type": "string"
                    },
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/products/{id}": {
      "get": {
        "operationId": "getProduct",
        "summary": "One product specification",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "sp-09",
                "sp-18",
                "idx-30",
                "hd-45",
                "pad-7090"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "product": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown id",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "list": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Verdict": {
        "type": "string",
        "enum": [
          "recommended",
          "marginal",
          "not-recommended"
        ]
      }
    }
  }
}
