{
  "openapi": "3.1.0",
  "info": {
    "title": "NAREZAI API",
    "version": "1.0.0",
    "description": "Личный API загрузки и поиска клипов.",
    "contact": {
      "url": "https://narezai.com/developers"
    }
  },
  "servers": [
    {
      "url": "https://api.narezai.com/api/public/v1"
    }
  ],
  "security": [
    {
      "bearerKey": []
    }
  ],
  "paths": {
    "/quota": {
      "get": {
        "summary": "Проверить квоту",
        "operationId": "getQuota",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Запрос выполнен",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quota"
                }
              }
            }
          },
          "401": {
            "description": "Недействующий ключ",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Недоступно для ключа или тарифа",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Превышена частота или заняты места",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Через сколько секунд можно повторить. Заголовок присутствует для ограничения частоты.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/uploads": {
      "post": {
        "summary": "Получить адрес загрузки",
        "operationId": "createUpload",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9_-]{1,64}$"
            },
            "description": "Уникальное значение для новой операции. Повтор той же операции использует точно такой же ключ."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUpload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Запрос выполнен",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "400": {
            "description": "Недопустимые параметры",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Недействующий ключ",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Недоступно для ключа или тарифа",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт параметров или состояния",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Ссылка истекла",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Превышен предел файла или хранилища",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Превышена частота или заняты места",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Через сколько секунд можно повторить. Заголовок присутствует для ограничения частоты.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/uploads/{id}": {
      "get": {
        "summary": "Проверить загрузку",
        "operationId": "getUpload",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Запрос выполнен",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadStatus"
                }
              }
            }
          },
          "401": {
            "description": "Недействующий ключ",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Недоступно для ключа или тарифа",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс отсутствует",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Превышена частота или заняты места",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Через сколько секунд можно повторить. Заголовок присутствует для ограничения частоты.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/jobs": {
      "get": {
        "summary": "Получить список задач",
        "operationId": "listJobs",
        "parameters": [
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{24}$"
            },
            "description": "Непустое next из предыдущей страницы"
          }
        ],
        "responses": {
          "200": {
            "description": "Запрос выполнен",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobList"
                }
              }
            }
          },
          "400": {
            "description": "Недопустимые параметры",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Недействующий ключ",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Недоступно для ключа или тарифа",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Превышена частота или заняты места",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Через сколько секунд можно повторить. Заголовок присутствует для ограничения частоты.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Запустить обработку",
        "operationId": "createJob",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9_-]{1,64}$"
            },
            "description": "Уникальное значение для новой операции. Повтор той же операции использует точно такой же ключ."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJob"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Задача принята",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "Недопустимые параметры",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Недействующий ключ",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Не хватает минут",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Недоступно для ключа или тарифа",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс отсутствует",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт параметров или состояния",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Превышена частота или заняты места",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Через сколько секунд можно повторить. Заголовок присутствует для ограничения частоты.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/jobs/{id}": {
      "get": {
        "summary": "Проверить состояние задачи",
        "operationId": "getJob",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Запрос выполнен",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "description": "Недействующий ключ",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Недоступно для ключа или тарифа",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс отсутствует",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Превышена частота или заняты места",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Через сколько секунд можно повторить. Заголовок присутствует для ограничения частоты.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Отменить задачу",
        "operationId": "cancelJob",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Запрос выполнен",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cancel"
                }
              }
            }
          },
          "401": {
            "description": "Недействующий ключ",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Недоступно для ключа или тарифа",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс отсутствует",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Превышена частота или заняты места",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Через сколько секунд можно повторить. Заголовок присутствует для ограничения частоты.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/jobs/{id}/clips": {
      "get": {
        "summary": "Получить границы клипов",
        "operationId": "listClips",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Запрос выполнен",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Clips"
                }
              }
            }
          },
          "401": {
            "description": "Недействующий ключ",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Недоступно для ключа или тарифа",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ресурс отсутствует",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Конфликт параметров или состояния",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Превышена частота или заняты места",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Через сколько секунд можно повторить. Заголовок присутствует для ограничения частоты.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Временная недоступность",
            "headers": {
              "X-Request-ID": {
                "description": "Идентификатор запроса для поддержки",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Narezai API key"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "Quota": {
        "type": "object",
        "properties": {
          "plan": {
            "type": "string"
          },
          "cloudMinutes": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer",
                "minimum": 0
              },
              "used": {
                "type": "integer",
                "minimum": 0
              },
              "left": {
                "type": "integer",
                "minimum": 0
              },
              "periodStart": {
                "type": "string",
                "format": "date-time"
              },
              "periodEnd": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "limit",
              "used",
              "left",
              "periodStart",
              "periodEnd"
            ]
          },
          "storageBytes": {
            "type": "integer",
            "minimum": 0
          },
          "cloudJobs": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "plan",
          "cloudMinutes",
          "storageBytes",
          "cloudJobs"
        ]
      },
      "CreateUpload": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4294967296
          }
        },
        "required": [
          "name",
          "size"
        ]
      },
      "Upload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{24}$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "uploadUrl": {
            "type": "string",
            "format": "uri"
          },
          "headers": {
            "type": "object",
            "properties": {
              "Content-Length": {
                "type": "string"
              },
              "If-None-Match": {
                "const": "*"
              }
            },
            "required": [
              "Content-Length",
              "If-None-Match"
            ]
          }
        },
        "required": [
          "id",
          "expiresAt",
          "uploadUrl",
          "headers"
        ]
      },
      "UploadStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{24}$"
          },
          "state": {
            "enum": [
              "awaiting_file",
              "ready",
              "expired"
            ]
          },
          "size": {
            "type": "integer",
            "minimum": 0
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "state",
          "size",
          "expiresAt"
        ]
      },
      "Search": {
        "type": "object",
        "properties": {
          "count": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 100
          },
          "durationMinSeconds": {
            "type": "integer",
            "minimum": 5,
            "maximum": 600
          },
          "durationMaxSeconds": {
            "type": "integer",
            "minimum": 5,
            "maximum": 600
          },
          "allowThoughtCompletion": {
            "type": "boolean"
          },
          "focus": {
            "type": "string"
          },
          "wish": {
            "type": "string",
            "maxLength": 4000
          }
        },
        "required": [
          "durationMinSeconds",
          "durationMaxSeconds"
        ]
      },
      "CreateJob": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string",
            "pattern": "^[a-f0-9]{24}$"
          },
          "durationS": {
            "type": "number",
            "minimum": 1,
            "maximum": 10800
          },
          "title": {
            "type": "string",
            "maxLength": 120
          },
          "language": {
            "type": "string",
            "default": "auto"
          },
          "search": {
            "$ref": "#/components/schemas/Search"
          }
        },
        "required": [
          "uploadId",
          "durationS"
        ]
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{24}$"
          },
          "projectId": {
            "type": "string"
          },
          "state": {
            "enum": [
              "waiting",
              "searching",
              "done",
              "failed",
              "cancelled"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "projectId",
          "state",
          "createdAt"
        ]
      },
      "JobList": {
        "type": "object",
        "properties": {
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Job"
            }
          },
          "next": {
            "type": "string"
          }
        },
        "required": [
          "jobs",
          "next"
        ]
      },
      "Cancel": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "ok"
        ]
      },
      "Clip": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "startMs": {
            "type": "integer",
            "minimum": 0
          },
          "endMs": {
            "type": "integer",
            "minimum": 0
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "title",
          "startMs",
          "endMs"
        ]
      },
      "Clips": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "clips": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Clip"
            }
          }
        },
        "required": [
          "projectId",
          "title",
          "clips"
        ]
      }
    }
  }
}
