openapi: 3.1.0
info:
  title: ASLA.pro API
  version: "1.0"
  description: |
    Открытое API студии инженерной автоматизации ASLA.pro.
    Позволяет AI-агентам и интеграциям получать сведения об услугах и общаться с ИИ-консультантом.
    API не принимает и не хранит персональные данные. Человекочитаемое описание: https://asla.pro/llms.txt
servers:
  - url: "https://asla.pro"
paths:
  /api/v1/services.json:
    get:
      operationId: listServices
      summary: Список услуг с задачами, результатами и FAQ
      responses:
        "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Catalog" } } } }
  /api/v1/solutions.json:
    get:
      operationId: listSolutions
      summary: Решения по отраслям
      responses:
        "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Catalog" } } } }
  /api/v1/faq.json:
    get:
      operationId: listFaq
      summary: Частые вопросы
      responses:
        "200": { description: OK }
  /api/chat.php:
    get:
      operationId: chatStatus
      summary: Включён ли ИИ-консультант
      parameters: [{ name: status, in: query, schema: { type: string, enum: ["1"] } }]
      responses:
        "200": { description: OK, content: { application/json: { schema: { type: object, properties: { enabled: { type: boolean } } } } } }
    post:
      operationId: chatReply
      summary: Диалог с ИИ-помощником, который помогает составить ТЗ
      description: Переписка не сохраняется. Не передавайте персональные данные. Когда ТЗ готово, в ответе приходит поле brief.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [messages]
              properties:
                messages:
                  type: array
                  maxItems: 20
                  items: { type: object, required: [role, content], properties: { role: { type: string, enum: [user, assistant] }, content: { type: string, maxLength: 1500 } } }
                lang: { type: string, enum: [ru, en] }
      responses:
        "200": { description: OK, content: { application/json: { schema: { type: object, properties: { ok: { type: boolean }, reply: { type: string }, brief: { type: [object, "null"], description: "Готовое ТЗ: title, industry, current_process, goal, inputs, outputs, volume, constraints, open_questions, suggested_start" } } } } } }
        "503": { description: Консультант выключен }
components:
  schemas:
    Catalog:
      type: object
      properties:
        updated: { type: string }
