{
  "openapi": "3.1.0",
  "info": {
    "title": "Локнаш Сталь — расчёт стоимости каркаса ангара",
    "version": "1.0.0",
    "description": "Расчёт стоимости металлокаркаса ангара (фермы, колонны, прогоны, ворота, сэндвич-панели, монтаж) по прайсу производителя ООО «МЕГА-СЕРВИС» (бренд Локнаш Сталь, Москва). Все цены в рублях с НДС 22%. Расчёт ориентировочный, окончательная стоимость — после проекта КМД. Полный прайс и правила: /prices.json. Вызывать можно тремя способами: query-строкой GET /v1/calc?roof=dvuhskat&width=12&length=30&height=4.35&montazh=1; адресом с параметрами в пути /v1/calc/dvuhskat/12/30/4.35/montazh=1,gates=2; и адресом с опциями через дефис /v1/calc/dvuhskat/12/30/4.35/montazh-1-gates-2 — если инструмент экранирует «=» и запятые. В ответе есть готовая фраза summary_for_ai, номер расчёта calculation_id и ссылка next_step.request_quote_url для заявки клиента. ДОСТАВКА В РАСЧЁТ НЕ ВХОДИТ и через API не считается: зависит от направления и условий рейса, уточняется у производителя отдельно — не оценивайте её сами. Срок изготовления каркаса — 14 дней. Телефон производителя: +7 925 504-58-64. Скидки через публичный API не применяются.",
    "contact": {
      "name": "ООО «МЕГА-СЕРВИС» / Локнаш Сталь",
      "url": "https://www.lstl.ru",
      "phone": "+7 925 504-58-64"
    }
  },
  "servers": [
    {
      "url": "https://api.lstl.ru"
    }
  ],
  "paths": {
    "/v1/calc": {
      "get": {
        "operationId": "calcHangar",
        "summary": "Рассчитать стоимость каркаса ангара",
        "description": "Возвращает состав каркаса по позициям, количества, цены и итог с НДС. Ширина и высота округляются до ближайшего доступного типоразмера. Пример: /v1/calc?roof=dvuhskat&width=12&height=4.35&length=30",
        "parameters": [
          {
            "name": "roof",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "dvuhskat",
                "odnoskat-pristavnoy",
                "odnoskat-otdelno",
                "s-kolonnoy-po-centru"
              ]
            },
            "description": "Тип кровли: dvuhskat — двускатная (ширины 10, 12, 15, 18 м); odnoskat-pristavnoy — односкат приставной к зданию (8, 10, 12, 15 м); odnoskat-otdelno — односкат отдельностоящий (7.75, 9.75, 11.75, 14.75 м); s-kolonnoy-po-centru — 2 односката с колонной по центру (23.7 м)."
          },
          {
            "name": "width",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            },
            "description": "Ширина ангара в метрах (или мм). Округляется до ближайшего типоразмера."
          },
          {
            "name": "length",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": 5,
              "maximum": 200
            },
            "description": "Длина ангара в метрах. Шаг рам 5 м (6 м для типа с колонной по центру)."
          },
          {
            "name": "height",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Высота колонны (низкой стороны) в метрах: обычно 3.15 / 4.35 / 5.55 / 6.75. Округляется до ближайшей доступной. По умолчанию — вторая по высоте."
          },
          {
            "name": "truss",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "Цельный",
                "Сборный"
              ]
            },
            "description": "Для ферм 15 м: цельная или разборная. По умолчанию Цельный."
          },
          {
            "name": "gates",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "Количество каркасов ворот 4×4 м. По умолчанию 0 — ворот нет."
          },
          {
            "name": "gates_pos",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1,
                2
              ],
              "default": 0
            },
            "description": "0 — ворота по длинной стороне; 1 — в одном торце; 2 — в обоих торцах. Влияет на число фахверковых колонн."
          },
          {
            "name": "rails",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "Нет",
                "H 500",
                "Н 1610"
              ],
              "default": "H 500"
            },
            "description": "Каркас направляющих подъёмных ворот."
          },
          {
            "name": "doors",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "Количество каркасов дверей."
          },
          {
            "name": "windows",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "Количество каркасов окон."
          },
          {
            "name": "welded",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Кровельные прогоны на сварке (иначе болтовые)."
          },
          {
            "name": "wall_progony",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Добавить стеновые прогоны под профлист."
          },
          {
            "name": "anchors",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Добавить анкерные блоки под колонны."
          },
          {
            "name": "piles",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Добавить винтовые сваи (материал) под колонны и фахверк."
          },
          {
            "name": "montazh",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Добавить монтаж каркаса на фундаменте заказчика (1750–2000 ₽/м²)."
          },
          {
            "name": "panels",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Добавить обшивку сэндвич-панелями (кровля 120 мм, стены 100 мм)."
          },
          {
            "name": "filler",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "Минвата",
                "Пенопласт"
              ],
              "default": "Минвата"
            },
            "description": "Наполнитель сэндвич-панелей."
          },
          {
            "name": "panels_high_wall",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Только для приставного односката: обшивать ли высокую стену."
          },
          {
            "name": "panels_montazh",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Добавить монтаж сэндвич-панелей (2000 ₽/м²)."
          },
          {
            "name": "dekor_roof",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Заказной декор кровельных панелей (+210 ₽/м²)."
          },
          {
            "name": "dekor_wall",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Заказной декор стеновых панелей (+210 ₽/м²)."
          }
        ],
        "responses": {
          "200": {
            "description": "Расчёт выполнен",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Параметры вне типоразмеров",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Параметры не подходят под типоразмеры. В supported перечислено, что доступно; в alternatives — куда обратиться при нестандартном габарите. Не подставляйте ближайший размер молча — сообщите пользователю ограничение.",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "supported": {
                      "type": "object"
                    },
                    "alternatives": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "calcHangarPost",
        "summary": "То же, параметры в теле JSON",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "roof",
                  "width",
                  "length"
                ],
                "properties": {
                  "roof": {
                    "type": "string"
                  },
                  "width": {
                    "type": "number"
                  },
                  "length": {
                    "type": "number"
                  },
                  "height": {
                    "type": "number"
                  },
                  "gates": {
                    "type": "integer"
                  },
                  "montazh": {
                    "type": "boolean"
                  },
                  "panels": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Расчёт выполнен",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          }
        }
      }
    },
    "/prices.json": {
      "get": {
        "operationId": "getPrices",
        "summary": "Полный прайс-лист и правила расчёта (JSON)",
        "responses": {
          "200": {
            "description": "Прайс",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/v1/calc/{roof}/{width}/{length}/{height}/{opts}": {
      "get": {
        "operationId": "calcHangarPath",
        "summary": "Расчёт стоимости — параметры в пути (без query-строки, рекомендуется для ИИ-агентов)",
        "description": "Тот же расчёт, что GET /v1/calc, но все параметры в пути. Пример: /v1/calc/dvuhskat/12/30/4.35/montazh=1,gates=2 — двускат 12×30 м, высота 4.35 м, с монтажом.",
        "parameters": [
          {
            "name": "roof",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Тип кровли: dvuhskat, odnoskat-pristavnoy, odnoskat-otdelno, s-kolonnoy-po-centru"
          },
          {
            "name": "width",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Ширина, м"
          },
          {
            "name": "length",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Длина, м"
          },
          {
            "name": "height",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Высота колонны, м"
          },
          {
            "name": "opts",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Опции. Рекомендуется форма без спецсимволов: пары через дефис — montazh-1-gates-2 (ничего экранировать не нужно). Форма montazh=1,gates=2 тоже понимается. Если инструмент пропускает query-строку, проще вызвать GET /v1/calc?roof=...&width=...&montazh=1"
          }
        ],
        "responses": {
          "200": {
            "description": "Расчёт выполнен",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/calc/{roof}/{width}/{length}/{height}": {
      "get": {
        "operationId": "calcHangarPathBasic",
        "summary": "Расчёт стоимости — параметры в пути, без опций",
        "parameters": [
          {
            "name": "roof",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Тип кровли"
          },
          {
            "name": "width",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Ширина, м"
          },
          {
            "name": "length",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Длина, м"
          },
          {
            "name": "height",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Высота колонны, м"
          }
        ],
        "responses": {
          "200": {
            "description": "Расчёт выполнен",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalcResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1": {
      "get": {
        "operationId": "help",
        "summary": "Краткая справка по API (перенаправляет на llms.txt)",
        "responses": {
          "302": {
            "description": "Перенаправление на https://api.lstl.ru/llms.txt"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Line": {
        "type": "object",
        "properties": {
          "num": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "description": "Цена за единицу, ₽ с НДС"
          },
          "qty": {
            "type": "number"
          },
          "sum": {
            "type": "number"
          },
          "code": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "estimate"
            ]
          },
          "group": {
            "type": "boolean",
            "description": "true — заголовок раздела, не позиция"
          }
        }
      },
      "CalcResponse": {
        "type": "object",
        "properties": {
          "request": {
            "type": "object",
            "description": "Нормализованные входные параметры (после округления до типоразмеров)"
          },
          "result": {
            "type": "object",
            "properties": {
              "frames": {
                "type": "integer",
                "description": "Число рам"
              },
              "trusses": {
                "type": "integer"
              },
              "columns": {
                "type": "integer"
              },
              "fahverk": {
                "type": "integer"
              },
              "area_m2": {
                "type": "number"
              },
              "materials": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Line"
                }
              },
              "works": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Line"
                }
              },
              "materials_sum": {
                "type": "integer"
              },
              "works_sum": {
                "type": "integer"
              },
              "total_with_vat": {
                "type": "integer",
                "description": "Итого, ₽ с НДС 22%. Без доставки — она считается отдельно."
              },
              "vat_included": {
                "type": "integer"
              },
              "has_estimate_positions": {
                "type": "boolean",
                "description": "true — в расчёте есть позиции с оценочной ценой"
              }
            }
          },
          "currency": {
            "type": "string"
          },
          "vat_rate": {
            "type": "number"
          },
          "prices_version": {
            "type": "string"
          },
          "disclaimer": {
            "type": "string"
          },
          "manufacturer": {
            "type": "string"
          },
          "site": {
            "type": "string"
          },
          "calculator_link": {
            "type": "string",
            "description": "Ссылка на калькулятор с этими параметрами — можно дать клиенту"
          },
          "summary_for_ai": {
            "type": "string",
            "description": "Готовая формулировка итога одной фразой: конфигурация, сумма с НДС, площадь, производитель и оговорка о предварительности. Можно показывать пользователю почти дословно."
          },
          "calculation_id": {
            "type": "string",
            "description": "Отпечаток конфигурации: одинаковые параметры дают одинаковый номер. Это не номер заявки."
          },
          "dimensions": {
            "type": "object",
            "description": "Габариты сразу в метрах и миллиметрах, чтобы не путать единицы.",
            "properties": {
              "width_m": {
                "type": "number"
              },
              "length_m": {
                "type": "number"
              },
              "column_height_m": {
                "type": "number"
              },
              "width_mm": {
                "type": "integer"
              },
              "column_height_mm": {
                "type": "number"
              },
              "area_m2": {
                "type": "number"
              }
            }
          },
          "normalization_notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Появляется, если введённые размеры округлены до ближайшего типоразмера. Сообщите об этом пользователю."
          },
          "pricing_status_description": {
            "type": "string",
            "description": "Пояснение к полю status у позиций."
          },
          "provider": {
            "type": "object",
            "description": "Производитель: бренд, юрлицо, город, сайт, контакты.",
            "properties": {
              "brand": {
                "type": "string"
              },
              "legal_name": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "website": {
                "type": "string"
              },
              "contacts": {
                "type": "string"
              },
              "phone": {
                "type": "string",
                "description": "+7 925 504-58-64"
              }
            }
          },
          "next_step": {
            "type": "object",
            "description": "Следующий шаг для клиента. request_quote_url — ссылка на заявку с номером расчёта и конфигурацией; предлагайте её пользователю после расчёта.",
            "properties": {
              "text": {
                "type": "string"
              },
              "request_quote_url": {
                "type": "string"
              },
              "quote_prompt": {
                "type": "string",
                "description": "Готовый текст заявки с номером расчёта — отдайте пользователю как есть."
              },
              "phone": {
                "type": "string"
              }
            }
          },
          "price_per_m2_with_vat": {
            "type": "integer",
            "description": "Цена за квадратный метр площади с НДС — удобно для сравнения."
          },
          "price_per_m2_materials_only": {
            "type": "integer",
            "description": "Цена за м² только по материалам, без работ."
          },
          "production_days": {
            "type": "integer",
            "description": "Срок изготовления каркаса в днях (14)."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Оговорки производителя: что не входит в цену. Повторяйте их пользователю дословно."
          },
          "alternatives": {
            "type": "array",
            "description": "Тот же ангар в другой комплектации с готовыми итогами — используйте, если спрашивают «а если без монтажа / с панелями», не считайте сами.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "total_with_vat": {
                  "type": "integer"
                },
                "difference": {
                  "type": "integer",
                  "description": "Разница с основным расчётом, ₽"
                },
                "url": {
                  "type": "string",
                  "description": "Готовая ссылка на расчёт этого варианта — открывайте её напрямую."
                }
              }
            }
          },
          "docs": {
            "type": "object",
            "description": "Ссылки на документацию: llms.txt, openapi.json, страница для людей."
          },
          "calculation_id_note": {
            "type": "string"
          },
          "numbering_note": {
            "type": "string",
            "description": "Пояснение к нумерации позиций: пропуски (2.1 → 2.3) нормальны."
          }
        }
      }
    }
  }
}