{
  "paths": {
    "/api/v1/capabilities": {
      "get": {
        "operationId": "listCapabilities",
        "summary": "Посмотреть, что доступно сейчас",
        "tags": [
          "Функции"
        ],
        "description": "Возвращает доступные функции, модели, форматы загрузки и ограничения производства в текущем окружении API.",
        "x-required-scope": "projects:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicCapabilityPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works": {
      "get": {
        "operationId": "listProjects",
        "summary": "Посмотреть список проектов",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Возвращает доступные проекты. Фильтруйте по state, используйте cursor и limit для пагинации.",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicProjectPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createProject",
        "summary": "Создать новый проект",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Создаёт проект с указанным name. Используйте полученный ID для добавления материалов и запуска производства.",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicProject"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}": {
      "get": {
        "operationId": "getProject",
        "summary": "Посмотреть данные проекта",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Возвращает имя, состояние и текущую revision проекта для проверки перед изменением или запуском производства.",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicProject"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateProject",
        "summary": "Изменить данные проекта",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Меняет имя или состояние active/archived проекта. Передайте последний ETag в If-Match.",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Укажите последний ETag вместе с кавычками.",
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$",
              "example": "\"1\""
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicProject"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/resources": {
      "get": {
        "operationId": "listResources",
        "summary": "Посмотреть загруженные материалы",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Возвращает сценарии, персонажей, сцены, реквизит, эпизоды и кадры проекта. Тип выбирается через kind.",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "script",
                "character",
                "scene",
                "prop",
                "episode",
                "shot"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicResourcePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createResource",
        "summary": "Добавить материалы: сценарий, изображения",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Добавляет структурированный материал через kind и data, например текст сценария или описание кадра. Файлы загружаются через /uploads.",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourceInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicResource"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/resources/{resource_id}": {
      "get": {
        "operationId": "getResource",
        "summary": "Посмотреть один материал",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Возвращает тип, содержимое и revision материала с указанным resource_id в проекте.",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicResource"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateResource",
        "summary": "Изменить материал",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Обновляет kind и data материала. Передайте последний ETag в If-Match для защиты от конфликтующих правок.",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Укажите последний ETag вместе с кавычками.",
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$",
              "example": "\"1\""
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicResource"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/uploads": {
      "post": {
        "operationId": "createUpload",
        "summary": "Получить адрес для загрузки файла",
        "tags": [
          "Загрузки"
        ],
        "description": "Регистрирует метаданные и возвращает upload_url. Отправьте файл методом PUT, затем вызовите завершение загрузки. Поддерживаются TXT, Markdown, DOCX, PNG, JPEG, WebP, AVIF, WAV и ZIP. Ограничения размера общие со Studio: см. upload_limits в GET /capabilities. Сценарии: до 5 000 000 символов. Имя без разделителей пути. WAV — PCM или IEEE float.",
        "x-required-scope": "assets:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicUploadTicket"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/uploads/{upload_id}/complete": {
      "post": {
        "operationId": "completeUpload",
        "summary": "Сообщить, что файл загружен полностью",
        "tags": [
          "Загрузки"
        ],
        "description": "Проверяет загруженный файл по заявленным метаданным и возвращает ресурс для использования в производстве.",
        "x-required-scope": "assets:write",
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicAsset"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/assets/{asset_id}": {
      "get": {
        "operationId": "getAsset",
        "summary": "Посмотреть готовый файл и ссылку на скачивание",
        "tags": [
          "Файлы и результаты"
        ],
        "description": "Возвращает метаданные и подписанный download_url, если он доступен. Скачайте файл до истечения ссылки.",
        "x-required-scope": "assets:read",
        "parameters": [
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicAsset"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/plans": {
      "post": {
        "operationId": "createPlan",
        "deprecated": true,
        "summary": "Посмотреть план и нужные кредиты",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Посмотрите, что будет создано и сколько кредитов потребуется, не запуская само производство.",
        "x-required-scope": "runs:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicPlan"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/runs": {
      "post": {
        "operationId": "createRun",
        "deprecated": true,
        "summary": "Запустить производство",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Запускает производство по готовому plan_id и возвращает ID запуска. Проверяйте состояние и результат через getRun.",
        "x-required-scope": "runs:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRun"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/runs": {
      "get": {
        "operationId": "listRuns",
        "summary": "Посмотреть список запусков",
        "tags": [
          "Запуски"
        ],
        "description": "Возвращает запуски производства с фильтрами по проекту, состоянию, client_reference и периоду.",
        "x-required-scope": "runs:read",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "running",
                "awaiting_review",
                "stopping",
                "paused",
                "needs_attention",
                "partially_succeeded",
                "succeeded",
                "failed",
                "cancelled"
              ]
            }
          },
          {
            "name": "client_reference",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRunPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/runs/{run_id}": {
      "get": {
        "operationId": "getRun",
        "summary": "Посмотреть, как идёт производство",
        "tags": [
          "Запуски"
        ],
        "description": "Возвращает состояние, версию и доступные результаты запуска. Используйте эту версию при отправке решения.",
        "x-required-scope": "runs:read",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRun"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/runs/{run_id}/steps": {
      "get": {
        "operationId": "listRunSteps",
        "summary": "Посмотреть ход работы по шагам",
        "tags": [
          "Запуски"
        ],
        "description": "Возвращает шаги запуска и их состояния: ожидание, выполнение или завершение.",
        "x-required-scope": "runs:read",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStepPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/runs/{run_id}/events": {
      "get": {
        "operationId": "listRunEvents",
        "summary": "Посмотреть записи о ходе производства",
        "tags": [
          "Запуски"
        ],
        "description": "Возвращает события запуска, включая смену состояния и запросы проверки, для отслеживания хода производства.",
        "x-required-scope": "runs:read",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRunEventPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/runs/{run_id}/decisions": {
      "post": {
        "operationId": "decideRun",
        "summary": "Подтвердить продолжение или остановить",
        "tags": [
          "Запуски"
        ],
        "description": "Передаёт решение approve, stop, resume, cancel_remaining или retry_result. Укажите текущую версию в expected_version. retry_result возобновляет только проверку сохранённой видеозадачи. Передайте актуальный expected_version и step_id. Задача и резерв кредитов сохраняются без повторной генерации. Доступно в течение 24 часов после приёма. Другие неопределённые результаты или расходы требуют проверки оператором.",
        "x-required-scope": "runs:write",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecisionInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRun"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/jobs": {
      "post": {
        "operationId": "createJob",
        "deprecated": true,
        "summary": "Выполнить сразу одну функцию",
        "tags": [
          "Функции процесса"
        ],
        "description": "Можно выполнить только одну функцию, не запуская всё производство. analyze_script читает сценарий и создаёт кадры, generate_image создаёт изображения персонажей, сцен, реквизита и кадров, generate_video создаёт видео для кадра с выбранным изображением, а assemble_video собирает эпизод, у которого все кадры уже с видео. Всегда отправляйте последнюю revision проекта. Запросы Live заранее резервируют кредиты.",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/jobs/{job_id}": {
      "get": {
        "operationId": "getJob",
        "summary": "Посмотреть состояние и результат задачи",
        "tags": [
          "Функции процесса"
        ],
        "description": "Возвращает состояние задания и ID выходных ресурсов. После завершения получите файлы через getAsset.",
        "x-required-scope": "jobs:read",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/requests": {
      "get": {
        "operationId": "listRequests",
        "summary": "Посмотреть отправленные запросы",
        "tags": [
          "Журналы запросов"
        ],
        "description": "Возвращает журнал API-запросов с HTTP-статусом и длительностью. Доступны фильтры по проекту и периоду.",
        "x-required-scope": "requests:read",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "run_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "job_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status_code",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599
            }
          },
          {
            "name": "method",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "GET",
                "POST",
                "PATCH",
                "PUT"
              ]
            }
          },
          {
            "name": "route_template",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRequestLogPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/requests/{request_id}": {
      "get": {
        "operationId": "getRequest",
        "summary": "Посмотреть один отправленный запрос",
        "tags": [
          "Журналы запросов"
        ],
        "description": "Находит вызов по request_id и возвращает HTTP-статус, длительность и связанный запуск или задание.",
        "x-required-scope": "requests:read",
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRequestLog"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Посмотреть расход кредитов",
        "tags": [
          "Использование"
        ],
        "description": "Возвращает итоги использования за период, включая зарезервированные и рассчитанные суммы.",
        "x-required-scope": "usage:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicUsage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/webhook-endpoints": {
      "get": {
        "operationId": "listWebhookEndpoints",
        "summary": "Посмотреть адреса Webhook",
        "tags": [
          "Webhook"
        ],
        "description": "Возвращает зарегистрированные URL Webhook, подписки на события и состояние активности.",
        "x-required-scope": "webhooks:read",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicWebhookEndpointPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createWebhookEndpoint",
        "summary": "Добавить адрес Webhook",
        "tags": [
          "Webhook"
        ],
        "description": "Регистрирует URL Webhook для получения выбранных событий производства по указанным проектам.",
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicWebhookIssued"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/webhook-endpoints/{endpoint_id}": {
      "patch": {
        "operationId": "updateWebhookEndpoint",
        "summary": "Изменить адрес Webhook",
        "tags": [
          "Webhook"
        ],
        "description": "Включает или отключает Webhook либо меняет список получаемых событий.",
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Укажите последний ETag вместе с кавычками.",
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$",
              "example": "\"1\""
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicWebhookEndpoint"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/webhook-deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "Посмотреть отправленные Webhook",
        "tags": [
          "Доставки Webhook"
        ],
        "description": "Возвращает попытки доставки Webhook и их состояния для проверки отправки уведомлений.",
        "x-required-scope": "webhooks:read",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicWebhookDeliveryPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/webhook-deliveries/{delivery_id}/redeliver": {
      "post": {
        "operationId": "redeliverWebhook",
        "summary": "Отправить Webhook ещё раз",
        "tags": [
          "Доставки Webhook"
        ],
        "description": "Запрашивает повторную доставку существующего уведомления Webhook по delivery_id.",
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicWebhookDelivery"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/uploads/{upload_id}/content": {
      "put": {
        "operationId": "uploadContent",
        "summary": "Загрузить содержимое файла",
        "tags": [
          "Загрузки"
        ],
        "description": "Передаёт байты файла как application/octet-stream по выданному адресу загрузки. После успеха вызовите completeUpload.",
        "x-required-scope": "assets:write",
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicUploaded"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/workflow": {
      "get": {
        "operationId": "getStudioWorkflow",
        "summary": "Данные производства Studio",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Возвращает сценарий, эпизоды, дизайны, сцены, ресурсы, дубли, выбор монтажа и текущую revision проекта.",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioWorkflow"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/workflow/commands": {
      "post": {
        "operationId": "executeStudioCommand",
        "deprecated": true,
        "summary": "Редактирование производства Studio",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Редактирует сценарий, сцены, дизайны или выбранные дубли. Выберите operation и передайте input с текущей revision.",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/script/analyses": {
      "post": {
        "operationId": "analyzeStudioScript",
        "summary": "Анализ сценария Studio",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Анализирует сценарий и извлекает структуру производства. Передайте script_text для обновления либо пропустите для анализа сохранённого текста. Отслеживайте через getJob.",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioAnalysis"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/cut/exports": {
      "post": {
        "operationId": "exportStudioCut",
        "deprecated": true,
        "summary": "Экспорт монтажа Studio",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Объединяет видео в порядке эпизодов и сцен. selections задаёт дубли, allow_partial разрешает пропуск отсутствующих сцен. Следите через getJob.",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioCutExport"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/storyboard/videos": {
      "post": {
        "operationId": "generateStudioVideo",
        "deprecated": true,
        "summary": "Создать видео сцены раскадровки",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Создаёт видео для scene_id с выбранными моделью, длительностью и разрешением. anchor_asset_id задаёт начальное изображение. Следите через getJob.",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioVideo"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/designs/images": {
      "post": {
        "operationId": "generateStudioImage",
        "deprecated": true,
        "summary": "Создать изображение персонажа, локации, реквизита или сетки",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Создаёт от одного до четырёх изображений для design_id по промпту и необязательным референсам. Выберите основной слот или вариант и следите через getJob.",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioImage"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/script/builds": {
      "post": {
        "operationId": "buildStudioScript",
        "summary": "Создать структуру производства из сценария",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Передайте проверенные script_asset_ids и revision для создания сценария, референсов и раскадровки. full_rebuild заменяет структуру. Изображения и видео создаются отдельно. Фактические входные и выходные токены оплачиваются по тарифам Studio. Бюджет кредитов для запроса не требуется. GET /jobs/{job_id} → output_asset_ids.",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioBuild"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/library": {
      "get": {
        "operationId": "listStudioLibrary",
        "summary": "Материалы общей библиотеки",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Возвращает материалы для импорта. scope=personal выбирает личную библиотеку, scope=studio по умолчанию — общую.",
        "x-required-scope": "assets:read",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "schema": {
              "type": "string",
              "enum": [
                "studio",
                "personal"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioLibrary"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/imports": {
      "post": {
        "operationId": "importStudioAsset",
        "summary": "Импорт материала в проект",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Копирует материал по asset_id из личной или общей библиотеки в проект. Последующие изменения или удаление оригинала не влияют на копию.",
        "x-required-scope": "assets:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioImport"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicAsset"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/script/drafts": {
      "post": {
        "operationId": "draftStudioScript",
        "summary": "Создать черновик сценария",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Передайте instructions, необязательный source_text, revision и max_output_tokens. Сохраняет новый сценарий без замены существующего. Фактические входные и выходные токены оплачиваются по тарифам Studio. Бюджет кредитов для запроса не требуется. GET /jobs/{job_id} → output_asset_ids.",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioDraft"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/jobs/{job_id}/build": {
      "get": {
        "operationId": "getStudioBuildProgress",
        "summary": "Получить прогресс и исходные материалы",
        "tags": [
          "Функции процесса"
        ],
        "description": "Возвращает этап, сообщения прогресса и исходные документы построения сценария, включая подготовленный для обработки текст.",
        "x-required-scope": "jobs:read",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioBuildProgress"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/characters": {
      "get": {
        "operationId": "listCharacters",
        "summary": "Персонаж · Просмотр (list)",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Персонаж · Просмотр (list). GET /api/v1/works/{work_id}/characters. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReferencePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createCharacter",
        "summary": "Персонаж · Создать",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Персонаж · Создать. POST /api/v1/works/{work_id}/characters. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createCharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/characters/{reference_id}": {
      "get": {
        "operationId": "getCharacter",
        "summary": "Персонаж · Просмотр",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Персонаж · Просмотр. GET /api/v1/works/{work_id}/characters/{reference_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReference"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateCharacter",
        "summary": "Персонаж · Изменить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Персонаж · Изменить. PATCH /api/v1/works/{work_id}/characters/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateCharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "deleteCharacter",
        "summary": "Персонаж · Удалить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Персонаж · Удалить. DELETE /api/v1/works/{work_id}/characters/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deleteCharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/characters/{reference_id}/primary-image": {
      "put": {
        "operationId": "setCharacterImage",
        "summary": "Персонаж · Задать референс",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Персонаж · Задать референс. PUT /api/v1/works/{work_id}/characters/{reference_id}/primary-image. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/setCharacterImageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/characters/{reference_id}/image-generations": {
      "post": {
        "operationId": "generateCharacterImage",
        "summary": "Персонаж · Создать референс",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Персонаж · Создать референс. POST /api/v1/works/{work_id}/characters/{reference_id}/image-generations. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/generateCharacterImageInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/references/characters/{reference_id}": {
      "put": {
        "operationId": "attachSceneCharacter",
        "summary": "Персонаж · Привязать к сцене",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Персонаж · Привязать к сцене. PUT /api/v1/works/{work_id}/scenes/{scene_id}/references/characters/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/attachSceneCharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "detachSceneCharacter",
        "summary": "Персонаж · Отвязать от сцены",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Персонаж · Отвязать от сцены. DELETE /api/v1/works/{work_id}/scenes/{scene_id}/references/characters/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/detachSceneCharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/background-scenes": {
      "get": {
        "operationId": "listBackgroundScenes",
        "summary": "Фон сцены · Просмотр (list)",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Фон сцены · Просмотр (list). GET /api/v1/works/{work_id}/background-scenes. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReferencePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createBackgroundScene",
        "summary": "Фон сцены · Создать",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Фон сцены · Создать. POST /api/v1/works/{work_id}/background-scenes. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createBackgroundSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/background-scenes/{reference_id}": {
      "get": {
        "operationId": "getBackgroundScene",
        "summary": "Фон сцены · Просмотр",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Фон сцены · Просмотр. GET /api/v1/works/{work_id}/background-scenes/{reference_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReference"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateBackgroundScene",
        "summary": "Фон сцены · Изменить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Фон сцены · Изменить. PATCH /api/v1/works/{work_id}/background-scenes/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateBackgroundSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "deleteBackgroundScene",
        "summary": "Фон сцены · Удалить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Фон сцены · Удалить. DELETE /api/v1/works/{work_id}/background-scenes/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deleteBackgroundSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/background-scenes/{reference_id}/primary-image": {
      "put": {
        "operationId": "setBackgroundSceneImage",
        "summary": "Фон сцены · Задать референс",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Фон сцены · Задать референс. PUT /api/v1/works/{work_id}/background-scenes/{reference_id}/primary-image. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/setBackgroundSceneImageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/background-scenes/{reference_id}/image-generations": {
      "post": {
        "operationId": "generateBackgroundSceneImage",
        "summary": "Фон сцены · Создать референс",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Фон сцены · Создать референс. POST /api/v1/works/{work_id}/background-scenes/{reference_id}/image-generations. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/generateBackgroundSceneImageInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/references/background-scenes/{reference_id}": {
      "put": {
        "operationId": "attachSceneBackgroundScene",
        "summary": "Фон сцены · Привязать к сцене",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Фон сцены · Привязать к сцене. PUT /api/v1/works/{work_id}/scenes/{scene_id}/references/background-scenes/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/attachSceneBackgroundSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "detachSceneBackgroundScene",
        "summary": "Фон сцены · Отвязать от сцены",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Фон сцены · Отвязать от сцены. DELETE /api/v1/works/{work_id}/scenes/{scene_id}/references/background-scenes/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/detachSceneBackgroundSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/props": {
      "get": {
        "operationId": "listProps",
        "summary": "Реквизит · Просмотр (list)",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Реквизит · Просмотр (list). GET /api/v1/works/{work_id}/props. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReferencePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createProp",
        "summary": "Реквизит · Создать",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Реквизит · Создать. POST /api/v1/works/{work_id}/props. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createPropInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/props/{reference_id}": {
      "get": {
        "operationId": "getProp",
        "summary": "Реквизит · Просмотр",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Реквизит · Просмотр. GET /api/v1/works/{work_id}/props/{reference_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReference"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateProp",
        "summary": "Реквизит · Изменить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Реквизит · Изменить. PATCH /api/v1/works/{work_id}/props/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updatePropInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "deleteProp",
        "summary": "Реквизит · Удалить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Реквизит · Удалить. DELETE /api/v1/works/{work_id}/props/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deletePropInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/props/{reference_id}/primary-image": {
      "put": {
        "operationId": "setPropImage",
        "summary": "Реквизит · Задать референс",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Реквизит · Задать референс. PUT /api/v1/works/{work_id}/props/{reference_id}/primary-image. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/setPropImageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/props/{reference_id}/image-generations": {
      "post": {
        "operationId": "generatePropImage",
        "summary": "Реквизит · Создать референс",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Реквизит · Создать референс. POST /api/v1/works/{work_id}/props/{reference_id}/image-generations. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/generatePropImageInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/references/props/{reference_id}": {
      "put": {
        "operationId": "attachSceneProp",
        "summary": "Реквизит · Привязать к сцене",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Реквизит · Привязать к сцене. PUT /api/v1/works/{work_id}/scenes/{scene_id}/references/props/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/attachScenePropInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "detachSceneProp",
        "summary": "Реквизит · Отвязать от сцены",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Реквизит · Отвязать от сцены. DELETE /api/v1/works/{work_id}/scenes/{scene_id}/references/props/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/detachScenePropInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/grids": {
      "get": {
        "operationId": "listGrids",
        "summary": "Сетка · Просмотр (list)",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сетка · Просмотр (list). GET /api/v1/works/{work_id}/grids. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReferencePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createGrid",
        "summary": "Сетка · Создать",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сетка · Создать. POST /api/v1/works/{work_id}/grids. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createGridInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/grids/{reference_id}": {
      "get": {
        "operationId": "getGrid",
        "summary": "Сетка · Просмотр",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сетка · Просмотр. GET /api/v1/works/{work_id}/grids/{reference_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReference"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateGrid",
        "summary": "Сетка · Изменить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сетка · Изменить. PATCH /api/v1/works/{work_id}/grids/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateGridInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "deleteGrid",
        "summary": "Сетка · Удалить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сетка · Удалить. DELETE /api/v1/works/{work_id}/grids/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deleteGridInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/grids/{reference_id}/primary-image": {
      "put": {
        "operationId": "setGridImage",
        "summary": "Сетка · Задать референс",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сетка · Задать референс. PUT /api/v1/works/{work_id}/grids/{reference_id}/primary-image. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/setGridImageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/grids/{reference_id}/image-generations": {
      "post": {
        "operationId": "generateGridImage",
        "summary": "Сетка · Создать референс",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сетка · Создать референс. POST /api/v1/works/{work_id}/grids/{reference_id}/image-generations. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/generateGridImageInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/references/grids/{reference_id}": {
      "put": {
        "operationId": "attachSceneGrid",
        "summary": "Сетка · Привязать к сцене",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сетка · Привязать к сцене. PUT /api/v1/works/{work_id}/scenes/{scene_id}/references/grids/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/attachSceneGridInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "detachSceneGrid",
        "summary": "Сетка · Отвязать от сцены",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сетка · Отвязать от сцены. DELETE /api/v1/works/{work_id}/scenes/{scene_id}/references/grids/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/detachSceneGridInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/episodes": {
      "get": {
        "operationId": "listEpisodes",
        "summary": "Эпизод · Просмотр (list)",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Эпизод · Просмотр (list). GET /api/v1/works/{work_id}/episodes. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicEpisodePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createEpisode",
        "summary": "Создать эпизод",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Создать эпизод. POST /api/v1/works/{work_id}/episodes. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createEpisodeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/episodes/{episode_id}": {
      "get": {
        "operationId": "getEpisode",
        "summary": "Эпизод · Просмотр",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Эпизод · Просмотр. GET /api/v1/works/{work_id}/episodes/{episode_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicEpisode"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateEpisode",
        "summary": "Эпизод · Изменить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Эпизод · Изменить. PATCH /api/v1/works/{work_id}/episodes/{episode_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateEpisodeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "deleteEpisode",
        "summary": "Эпизод · Удалить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Эпизод · Удалить. DELETE /api/v1/works/{work_id}/episodes/{episode_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deleteEpisodeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/episodes/{episode_id}/scenes": {
      "get": {
        "operationId": "listScenes",
        "summary": "Сцена · Просмотр (list)",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сцена · Просмотр (list). GET /api/v1/works/{work_id}/episodes/{episode_id}/scenes. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicScenePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createScene",
        "summary": "Создать сцену",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Создать сцену. POST /api/v1/works/{work_id}/episodes/{episode_id}/scenes. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/episodes/{episode_id}/scenes/{scene_id}": {
      "get": {
        "operationId": "getScene",
        "summary": "Сцена · Просмотр",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сцена · Просмотр. GET /api/v1/works/{work_id}/episodes/{episode_id}/scenes/{scene_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicScene"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateScene",
        "summary": "Сцена · Изменить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сцена · Изменить. PATCH /api/v1/works/{work_id}/episodes/{episode_id}/scenes/{scene_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/archive-imports": {
      "post": {
        "operationId": "createArchiveImport",
        "summary": "Импорт ZIP",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Импорт ZIP. POST /api/v1/works/{work_id}/archive-imports. Use a verified ZIP asset_id and current revision. Preserves the archive and uses the same name-based material update rules as Studio. Check imported, failed and asset_ids on completion. Creation requires jobs:create, assets:read, assets:write and projects:write. Idempotency-Key; GET /api/v1/works/{work_id}/archive-imports/{import_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createArchiveImportInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicArchiveImport"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/archive-imports/{import_id}": {
      "get": {
        "operationId": "getArchiveImport",
        "summary": "Статус импорта ZIP",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Статус импорта ZIP. GET /api/v1/works/{work_id}/archive-imports/{import_id}. Use a verified ZIP asset_id and current revision. Preserves the archive and uses the same name-based material update rules as Studio. Check imported, failed and asset_ids on completion. Creation requires jobs:create, assets:read, assets:write and projects:write. jobs:read",
        "x-required-scope": "jobs:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "import_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicArchiveImport"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/uploads": {
      "post": {
        "operationId": "createWorkUploads",
        "summary": "Подготовить пакет файлов",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Подготовить пакет файлов. POST /api/v1/works/{work_id}/uploads. Idempotency-Key + files (1–20) → PUT upload_url → POST /api/v1/uploads/{upload_id}/complete",
        "x-required-scope": "assets:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createWorkUploadsInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicUploadBatch"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}": {
      "delete": {
        "operationId": "deleteScene",
        "summary": "Сцена · Удалить",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сцена · Удалить. DELETE /api/v1/works/{work_id}/scenes/{scene_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deleteSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/episodes/{episode_id}/scene-order": {
      "put": {
        "operationId": "reorderScenes",
        "summary": "Изменить порядок сцен",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Изменить порядок сцен. PUT /api/v1/works/{work_id}/episodes/{episode_id}/scene-order. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/reorderScenesInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/script": {
      "put": {
        "operationId": "saveScript",
        "summary": "Сохранить сценарий",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Сохранить сценарий. PUT /api/v1/works/{work_id}/script. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/saveScriptInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/video-generations": {
      "post": {
        "operationId": "generateSceneVideo",
        "summary": "Создать видео сцены",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Создать видео сцены. POST /api/v1/works/{work_id}/scenes/{scene_id}/video-generations. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/generateSceneVideoInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/selected-take": {
      "put": {
        "operationId": "selectSceneTake",
        "summary": "Выбрать финальный дубль",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Выбрать финальный дубль. PUT /api/v1/works/{work_id}/scenes/{scene_id}/selected-take. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/selectSceneTakeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/exports": {
      "post": {
        "operationId": "exportWork",
        "summary": "Экспортировать итоговое видео",
        "tags": [
          "Проекты и ресурсы"
        ],
        "description": "Экспортировать итоговое видео. POST /api/v1/works/{work_id}/exports. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Повторяйте запрос с теми же Idempotency-Key и телом.",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/exportWorkInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Успешно",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "Ревизия изменяемого ресурса.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Рекомендуемый интервал опроса в секундах."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "operationId": "openapiDocument",
        "summary": "Скачать спецификацию API",
        "description": "Скачивает спецификацию OpenAPI с путями API, полями запросов и схемами ответов.",
        "tags": [
          "Спецификация"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Документ OpenAPI",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/downloads/{asset_id}": {
      "get": {
        "operationId": "downloadAsset",
        "summary": "Скачать готовый файл",
        "tags": [
          "Файлы и результаты"
        ],
        "security": [],
        "description": "Скачивает файл по полному подписанному download_url из getAsset. Ссылка действует пять минут.",
        "parameters": [
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "expires",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "signature",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Байты файла",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    }
  },
  "openapi": "3.1.0",
  "info": {
    "title": "FECINE Open API",
    "version": "1.1.0",
    "description": "API производства FECINE. Документация общедоступна, для вызова нужен ключ FECINE. GET /capabilities возвращает доступные функции. Live расходует кредиты, песочница возвращает тестовые данные. Повторяйте POST с тем же Idempotency-Key. Спецификация создаётся из действующих контрактов."
  },
  "servers": [
    {
      "url": "/",
      "description": "Текущий сервер FECINE"
    }
  ],
  "security": [
    {
      "PartnerApiKey": []
    }
  ],
  "components": {
    "responses": {
      "ApiError": {
        "description": "Ответ 2xx означает, что запрос принят. 201 — что-то создано, 202 — запрос принят и ещё выполняется, результата пока нет: проверяйте состояние задачи, чтобы узнать, когда она завершится.\nУспешные ответы содержат request_id и data. Исключения — скачивание файлов и документ спецификации.\nПри ошибке все эндпоинты возвращают error одного и того же вида. В коде ветвитесь по error.code, а message написан для человека и объясняет причину и что делать.\nМожно ли отправить запрос снова, показывает retryable. Повторяйте автоматически только при значении true и ждите столько, сколько указано в retry_after_seconds или в заголовке Retry-After. При повторе POST отправляйте тот же Idempotency-Key и то же тело, чтобы ничего не списалось и не создалось дважды.\nНезнакомый error.code обрабатывайте по HTTP-статусу и retryable. При обращении в поддержку указывайте request_id. Сбои после того, как задача принята, видны в её состоянии и результате, а не в этом ответе.",
        "headers": {
          "X-Request-Id": {
            "description": "Request identifier for support.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          "Retry-After": {
            "description": "Optional retry delay in seconds; check error.retryable.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "request_id": "11111111-1111-4111-8111-111111111111",
              "error": {
                "code": "INVALID_REQUEST",
                "message": "Invalid input. Check the required fields, types and values.",
                "retryable": false
              }
            }
          }
        },
        "x-error-codes": [
          {
            "code": "INVALID_REFERENCE",
            "status": "422",
            "description": "A selected reference is unavailable or does not belong to this project. Select a ready image from this project."
          },
          {
            "code": "MODEL_UNAVAILABLE",
            "status": "422",
            "description": "The selected model is unavailable. Refresh the model list and select another model."
          },
          {
            "code": "MODEL_POLICY_REQUIRED",
            "status": "503",
            "description": "No default model policy is configured. Specify a model or ask the administrator to configure the task policy."
          },
          {
            "code": "BUILD_REPLAY_CONFLICT",
            "status": "409",
            "description": "The build inputs changed. Review the saved build before continuing."
          },
          {
            "code": "INVALID_REQUEST",
            "status": "400,422",
            "description": "Invalid input. Check the required fields, types and values."
          },
          {
            "code": "INVALID_API_KEY",
            "status": "401",
            "description": "Invalid credentials or download signature. Check the API key or obtain a new download URL."
          },
          {
            "code": "INSUFFICIENT_SCOPE",
            "status": "403",
            "description": "Permission denied. Check the key scopes and project access."
          },
          {
            "code": "PARTNER_BLOCKED",
            "status": "403",
            "description": "Account blocked. Contact support."
          },
          {
            "code": "PARTNER_PAUSED",
            "status": "403",
            "description": "Account paused. Ask the administrator to resume access."
          },
          {
            "code": "RESOURCE_NOT_FOUND",
            "status": "404",
            "description": "Resource unavailable. Check its ID and access permissions."
          },
          {
            "code": "METHOD_NOT_ALLOWED",
            "status": "405",
            "description": "Unsupported HTTP method. Use the documented method."
          },
          {
            "code": "REQUEST_TIMEOUT",
            "status": "408",
            "description": "Request body timed out. Check the connection and upload size."
          },
          {
            "code": "IDEMPOTENCY_KEY_REQUIRED",
            "status": "400",
            "description": "Provide a valid Idempotency-Key header."
          },
          {
            "code": "IDEMPOTENCY_CONFLICT",
            "status": "409",
            "description": "This Idempotency-Key belongs to a different request. Reuse it only with the original request."
          },
          {
            "code": "IDEMPOTENCY_KEY_EXPIRED",
            "status": "409",
            "description": "Idempotency record expired. Check the original result before starting a new operation."
          },
          {
            "code": "PRECONDITION_FAILED",
            "status": "412",
            "description": "Provide the latest quoted ETag in If-Match."
          },
          {
            "code": "REVISION_CONFLICT",
            "status": "409",
            "description": "Resource changed. Read the latest revision before updating."
          },
          {
            "code": "RESOURCE_CONFLICT",
            "status": "409",
            "description": "Resource conflicts with existing data. Review the current resource."
          },
          {
            "code": "INVALID_TRANSITION",
            "status": "409",
            "description": "Action is unavailable in the current state. Read the latest state."
          },
          {
            "code": "RUN_IN_PROGRESS",
            "status": "409",
            "description": "A run is in progress. Check its status before starting another."
          },
          {
            "code": "JOB_RUNNING",
            "status": "409",
            "description": "A job is running. Wait for completion before editing."
          },
          {
            "code": "PLAN_EXPIRED",
            "status": "409",
            "description": "Plan expired. Create a new plan and review its quote."
          },
          {
            "code": "INSUFFICIENT_CREDITS",
            "status": "402",
            "description": "Insufficient credits. Check the balance and required credits."
          },
          {
            "code": "BUDGET_EXCEEDED",
            "status": "409,429",
            "description": "Budget limit exceeded. Review usage and the configured budget."
          },
          {
            "code": "RATE_LIMITED",
            "status": "429",
            "description": "Request rate exceeded. Follow retryable and Retry-After before retrying."
          },
          {
            "code": "CAPACITY_EXCEEDED",
            "status": "429",
            "description": "Capacity limit exceeded. Reduce the workload or wait for active work to finish."
          },
          {
            "code": "PAYLOAD_TOO_LARGE",
            "status": "413",
            "description": "Request body too large. Reduce it to the documented limit."
          },
          {
            "code": "UNSUPPORTED_MEDIA_TYPE",
            "status": "415",
            "description": "Unsupported content type or encoding. Use the documented Content-Type without Content-Encoding."
          },
          {
            "code": "UPLOAD_TOO_LARGE",
            "status": "422",
            "description": "Uploaded content exceeds its processing limit. Reduce the file size."
          },
          {
            "code": "UPLOAD_NOT_VERIFIED",
            "status": "422",
            "description": "Upload is incomplete, expired or invalid. Check the upload and verification steps."
          },
          {
            "code": "ASSET_KIND_MISMATCH",
            "status": "422",
            "description": "Asset type does not match the operation. Select a compatible asset."
          },
          {
            "code": "SELECTED_IMAGE_REQUIRED",
            "status": "422",
            "description": "Select a valid image before generating video."
          },
          {
            "code": "SELECTED_VIDEO_REQUIRED",
            "status": "422",
            "description": "Select valid videos for the requested shots before assembly."
          },
          {
            "code": "REFERENCE_LIMIT_EXCEEDED",
            "status": "422",
            "description": "Too many reference assets. Reduce them to the model limit."
          },
          {
            "code": "REFERENCE_IMAGE_REQUIRED",
            "status": "422",
            "description": "This model requires a reference image. Add an image or select a text-to-image model."
          },
          {
            "code": "INVALID_GENERATION_OPTIONS",
            "status": "422",
            "description": "Generation options are invalid. Check the model capabilities."
          },
          {
            "code": "PROMPT_REQUIRED",
            "status": "422",
            "description": "Provide a generation prompt."
          },
          {
            "code": "SCRIPT_TEXT_REQUIRED",
            "status": "422",
            "description": "Provide script text before starting this operation."
          },
          {
            "code": "SCENES_REQUIRED",
            "status": "422",
            "description": "Create scenes before starting this operation."
          },
          {
            "code": "VARIANT_NAME_REQUIRED",
            "status": "422",
            "description": "Provide a variant name."
          },
          {
            "code": "EPISODE_ALREADY_STRUCTURED",
            "status": "409",
            "description": "Episode already has shots. Review its existing structure."
          },
          {
            "code": "ONE_SCRIPT_PER_PROJECT",
            "status": "409",
            "description": "This project supports one script. Use the existing script."
          },
          {
            "code": "MULTIPLE_SCRIPTS_REQUIRE_REVIEW",
            "status": "409",
            "description": "Multiple scripts need review before continuing."
          },
          {
            "code": "NATIVE_CONTENT_ALREADY_EXISTS",
            "status": "409",
            "description": "Studio content already exists. Review it before continuing."
          },
          {
            "code": "LIVE_PROJECT_REQUIRED",
            "status": "409",
            "description": "This operation requires a live project."
          },
          {
            "code": "STUDIO_MIGRATION_REQUIRED",
            "status": "409",
            "description": "Project needs Studio migration. Contact support."
          },
          {
            "code": "UNSUPPORTED_CAPABILITY",
            "status": "422",
            "description": "Unsupported operation or profile. Check GET /capabilities."
          },
          {
            "code": "CAPABILITY_UNAVAILABLE",
            "status": "503",
            "description": "Capability currently unavailable. Check GET /capabilities."
          },
          {
            "code": "API_NOT_ACCEPTING",
            "status": "503",
            "description": "New requests are paused. Check service availability."
          },
          {
            "code": "DEPENDENCY_UNAVAILABLE",
            "status": "503",
            "description": "A required service is unavailable. Follow the retry guidance or contact support."
          },
          {
            "code": "PRICING_UNAVAILABLE",
            "status": "503",
            "description": "Pricing unavailable. A valid quote is required to proceed."
          },
          {
            "code": "MEDIA_TOOLS_UNAVAILABLE",
            "status": "503",
            "description": "Media processing unavailable. Contact support."
          },
          {
            "code": "STORAGE_READ_FAILED",
            "status": "503",
            "description": "Could not read the stored asset. Contact support with request_id."
          },
          {
            "code": "STORAGE_WRITE_FAILED",
            "status": "503",
            "description": "Could not save the asset. Check the result before retrying."
          },
          {
            "code": "INTERNAL_ERROR",
            "status": "500",
            "description": "Internal error. Follow retry guidance; include request_id when contacting support."
          },
          {
            "code": "RESPONSE_CONTRACT_VIOLATION",
            "status": "500",
            "description": "Server response validation failed. Contact support with request_id."
          },
          {
            "code": "INVALID_EXECUTION_CONTEXT",
            "status": "500",
            "description": "Execution context is invalid. Contact support."
          },
          {
            "code": "RETRY_TRANSACTION",
            "status": "503",
            "description": "Transaction could not complete. Follow the response retry guidance."
          },
          {
            "code": "CLAIM_LOST",
            "status": "409",
            "description": "Execution ownership changed. Check the current job state."
          },
          {
            "code": "PROVIDER_TIMEOUT",
            "status": "504",
            "description": "Generation service timed out. Check the existing job before submitting again."
          },
          {
            "code": "PROVIDER_TERMINAL_FAILURE",
            "status": "422",
            "description": "Generation failed. Review the job result and inputs."
          },
          {
            "code": "PROVIDER_RESULT_UNAVAILABLE",
            "status": "502",
            "description": "Generation result unavailable. Check the existing job and recovery options."
          },
          {
            "code": "INVALID_RESULT",
            "status": "422,503",
            "description": "Result failed validation. Review the job or contact support."
          },
          {
            "code": "RESULT_TOO_LARGE",
            "status": "422",
            "description": "Result exceeds the processing limit. Reduce the requested output."
          },
          {
            "code": "EXPORT_TOO_LARGE",
            "status": "422",
            "description": "Export exceeds the size limit. Reduce the export selection."
          },
          {
            "code": "RECOVERY_BACKOFF",
            "status": "409",
            "description": "Existing result recovery is delayed. Check again later; do not resubmit generation."
          },
          {
            "code": "VIDEO_RECOVERY_REVIEW_REQUIRED",
            "status": "503",
            "description": "The original video task needs scheduled recovery or operator review. Do not resubmit generation."
          },
          {
            "code": "RESULT_RECOVERY_REQUIRED",
            "status": "409,503",
            "description": "Existing result needs recovery. Check the run recovery options before resubmitting."
          },
          {
            "code": "RESULT_NOT_RECOVERABLE",
            "status": "409",
            "description": "Result cannot be recovered through this action. Review the run or contact support."
          },
          {
            "code": "RECOVERY_CAPACITY_EXCEEDED",
            "status": "409",
            "description": "Recovery limit reached. Contact support before further recovery attempts."
          },
          {
            "code": "USAGE_RECOVERY_REQUIRED",
            "status": "503",
            "description": "Usage needs reconciliation. Contact support; do not resubmit generation blindly."
          }
        ]
      }
    },
    "securitySchemes": {
      "PartnerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "FECINE API Key",
        "description": "Введите ключ FECINE fec_live_* или fec_test_*."
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable error identifier. See components.responses.ApiError.x-error-codes; handle unknown codes safely."
              },
              "message": {
                "type": "string",
                "description": "Human-readable cause and action. Use code, not message, for program logic."
              },
              "retryable": {
                "type": "boolean",
                "description": "Whether automatic retry is allowed. Do not infer this from the HTTP status alone."
              },
              "retry_after_seconds": {
                "type": "integer",
                "minimum": 1,
                "description": "Wait at least this many seconds before an allowed retry."
              }
            },
            "required": [
              "code",
              "message",
              "retryable"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "error"
        ],
        "additionalProperties": false
      },
      "Money": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "micro_units": {
            "type": "string",
            "pattern": "^[0-9]+$"
          }
        },
        "required": [
          "currency",
          "micro_units"
        ],
        "additionalProperties": false
      },
      "ProjectCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "client_reference": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ProjectPatch": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          }
        },
        "additionalProperties": false,
        "description": "Необходимо хотя бы одно поле."
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "client_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "revision",
          "state",
          "created_at",
          "client_reference"
        ],
        "additionalProperties": false
      },
      "ResourceInput": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "script"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 900000
                  },
                  "source_asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "language": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 16
                  }
                },
                "required": [
                  "language"
                ],
                "additionalProperties": false,
                "description": "Укажите только text или source_asset_id."
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "character"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "reference_asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 8,
                    "default": []
                  }
                },
                "required": [
                  "description"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "scene"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "reference_asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 8,
                    "default": []
                  }
                },
                "required": [
                  "description"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "prop"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "reference_asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 8,
                    "default": []
                  }
                },
                "required": [
                  "description"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "episode"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "script_resource_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "sequence": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "raw_content": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  }
                },
                "required": [
                  "script_resource_id",
                  "sequence"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "shot"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "episode_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "scene_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "character_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 8,
                    "default": []
                  },
                  "prop_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 8,
                    "default": []
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "video_prompt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "sequence": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "duration_seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 60
                  },
                  "selected_image_asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "selected_video_asset_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "episode_id",
                  "description",
                  "duration_seconds"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Resource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "content": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "script"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 900000
                      },
                      "source_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "language": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 16
                      }
                    },
                    "required": [
                      "language"
                    ],
                    "additionalProperties": false,
                    "description": "Укажите только text или source_asset_id."
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "character"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "scene"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "prop"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "episode"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "script_resource_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "sequence": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "raw_content": {
                        "type": "string",
                        "maxLength": 20000
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      }
                    },
                    "required": [
                      "script_resource_id",
                      "sequence"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "shot"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "episode_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "scene_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "character_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      },
                      "prop_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "video_prompt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 4000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sequence": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "duration_seconds": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      },
                      "selected_image_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "selected_video_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "episode_id",
                      "description",
                      "duration_seconds"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "project_id",
          "revision",
          "content",
          "created_at"
        ],
        "additionalProperties": false
      },
      "Capability": {
        "type": "object",
        "properties": {
          "studio_workflow": {
            "type": "object",
            "properties": {
              "equivalent": {
                "type": "boolean"
              },
              "stages": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "script",
                    "designs",
                    "storyboard",
                    "cut"
                  ]
                }
              },
              "project_access": {
                "type": "string",
                "enum": [
                  "read_only",
                  "read_write",
                  "mixed"
                ]
              },
              "gaps": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "operations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "path",
                    "enabled"
                  ],
                  "additionalProperties": false
                },
                "default": []
              },
              "commands": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "image_models": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "aspect_ratios": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "image_sizes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "max_reference_images": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "max_variants": {
                      "type": "integer",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "id",
                    "enabled",
                    "aspect_ratios",
                    "image_sizes",
                    "max_reference_images",
                    "max_variants"
                  ],
                  "additionalProperties": false
                },
                "default": []
              }
            },
            "required": [
              "equivalent",
              "stages",
              "project_access",
              "gaps"
            ],
            "additionalProperties": false
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "template_version": {
            "type": "integer",
            "minimum": 1
          },
          "enabled": {
            "type": "boolean"
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "output_profiles": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "unsupported_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          "max_shots": {
            "type": "integer",
            "minimum": 1
          },
          "max_episode_seconds": {
            "type": "integer",
            "minimum": 1
          },
          "upload_mime_types": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "max_upload_bytes": {
            "type": "integer",
            "minimum": 1
          },
          "upload_limits": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "exclusiveMinimum": 0
            }
          },
          "job_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "analyze_script",
                "generate_image",
                "generate_video",
                "assemble_video"
              ]
            }
          },
          "operations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "type",
                "enabled"
              ],
              "additionalProperties": false
            }
          },
          "image_size": {
            "type": "string"
          },
          "max_reference_images": {
            "type": "integer"
          }
        },
        "required": [
          "studio_workflow",
          "template_id",
          "template_version",
          "enabled",
          "stages",
          "output_profiles",
          "unsupported_reasons",
          "max_shots",
          "max_episode_seconds",
          "upload_mime_types",
          "max_upload_bytes"
        ],
        "additionalProperties": false
      },
      "PlanInput": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "const": "episode-production"
          },
          "template_version": {
            "type": "number",
            "const": 1
          },
          "project_revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "episode_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1,
            "maxItems": 10,
            "description": "ID эпизодов должны быть уникальными."
          },
          "mode": {
            "type": "string",
            "enum": [
              "reviewed",
              "automatic"
            ]
          },
          "output_profile": {
            "type": "string",
            "enum": [
              "sandbox-episode-v1",
              "episode-standard-v1"
            ]
          }
        },
        "required": [
          "template_id",
          "template_version",
          "project_revision",
          "episode_ids",
          "mode",
          "output_profile"
        ],
        "additionalProperties": false
      },
      "PlannedStep": {
        "type": "object",
        "properties": {
          "stage_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "target_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "depends_on": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "requires_review": {
            "type": "boolean"
          },
          "max_cost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "stage_key",
          "target_ids",
          "depends_on",
          "requires_review",
          "max_cost"
        ],
        "additionalProperties": false
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "project_revision": {
            "type": "integer",
            "minimum": 1
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "template_version": {
            "type": "integer",
            "minimum": 1
          },
          "executable": {
            "type": "boolean"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "budget_ceiling": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "stage_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "target_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "depends_on": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "requires_review": {
                  "type": "boolean"
                },
                "max_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "stage_key",
                "target_ids",
                "depends_on",
                "requires_review",
                "max_cost"
              ],
              "additionalProperties": false
            }
          },
          "unsupported_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          }
        },
        "required": [
          "id",
          "project_id",
          "project_revision",
          "template_id",
          "template_version",
          "executable",
          "expires_at",
          "budget_ceiling",
          "steps",
          "unsupported_reasons"
        ],
        "additionalProperties": false
      },
      "RunInput": {
        "type": "object",
        "properties": {
          "plan_id": {
            "type": "string",
            "format": "uuid"
          },
          "client_reference": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "plan_id"
        ],
        "additionalProperties": false
      },
      "Run": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "plan_id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "awaiting_review",
              "stopping",
              "paused",
              "needs_attention",
              "partially_succeeded",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "client_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "budget_remaining": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "committed_cost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "unresolved_cost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "output_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "id",
          "project_id",
          "plan_id",
          "version",
          "state",
          "client_reference",
          "created_at",
          "completed_at",
          "budget_remaining",
          "committed_cost",
          "unresolved_cost",
          "output_asset_ids"
        ],
        "additionalProperties": false
      },
      "Step": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "stage_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "target_id": {
            "type": "string",
            "format": "uuid"
          },
          "job_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "blocked",
              "ready",
              "queued",
              "running",
              "awaiting_review",
              "succeeded",
              "failed",
              "cancelled",
              "unknown"
            ]
          },
          "output_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "ordinal": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "run_id",
          "stage_key",
          "target_id",
          "job_id",
          "state",
          "output_asset_ids",
          "error_code",
          "ordinal"
        ],
        "additionalProperties": false
      },
      "RunEvent": {
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "run.state_changed",
              "run.review_required",
              "run.result_ready",
              "run.needs_attention"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "awaiting_review",
              "stopping",
              "paused",
              "needs_attention",
              "partially_succeeded",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "step_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "event_id",
          "run_id",
          "sequence",
          "type",
          "state",
          "step_id",
          "created_at"
        ],
        "additionalProperties": false
      },
      "DecisionInput": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "approve",
              "stop",
              "resume",
              "cancel_remaining",
              "retry_result"
            ],
            "description": "retry_result resumes result polling for an accepted Studio video on the original reservation; requires step_id and expected_version. It never resubmits generation. Unconfirmed usage without a saved video task requires operator review."
          },
          "expected_version": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "step_id": {
            "type": "string",
            "format": "uuid"
          },
          "selected_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 10
          }
        },
        "required": [
          "action",
          "expected_version"
        ],
        "additionalProperties": false
      },
      "JobInput": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "project_revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "target_id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "analyze_script",
              "generate_image",
              "generate_video",
              "assemble_video"
            ]
          },
          "profile_id": {
            "type": "string",
            "maxLength": 100
          },
          "client_reference": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "project_id",
          "project_revision",
          "target_id",
          "type",
          "profile_id"
        ],
        "additionalProperties": false
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "ready",
              "blocked",
              "processing",
              "awaiting_review",
              "succeeded",
              "failed",
              "cancelled",
              "needs_review"
            ]
          },
          "output_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "resource_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "skipped_scene_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "id",
          "project_id",
          "run_id",
          "state",
          "output_asset_ids",
          "error_code"
        ],
        "additionalProperties": false
      },
      "UploadInput": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[^\\\\/\\x00-\\x1f]+$"
          },
          "mime_type": {
            "type": "string",
            "enum": [
              "text/plain",
              "text/markdown",
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
              "image/png",
              "image/jpeg",
              "image/webp",
              "image/avif",
              "audio/wav",
              "application/zip"
            ]
          },
          "size_bytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1073741824
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "project_id",
          "filename",
          "mime_type",
          "size_bytes",
          "sha256"
        ],
        "additionalProperties": false,
        "description": "Поддерживаются TXT, Markdown, DOCX, PNG, JPEG, WebP, AVIF, WAV и ZIP. Ограничения размера общие со Studio: см. upload_limits в GET /capabilities. Сценарии: до 5 000 000 символов. Имя без разделителей пути. WAV — PCM или IEEE float."
      },
      "UploadTicket": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "upload_url": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "content_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "asset_id",
          "upload_url",
          "method",
          "content_type",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "Asset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "ready",
              "errored",
              "expired"
            ]
          },
          "mime_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "download_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "project_id",
          "state",
          "mime_type",
          "size_bytes",
          "download_url",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "RequestLog": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST",
              "PATCH",
              "PUT"
            ]
          },
          "route_template": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "status_code": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          },
          "actor_kind": {
            "type": "string",
            "enum": [
              "api_key",
              "console"
            ]
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "job_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "replayed": {
            "type": "boolean"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "request_id",
          "created_at",
          "method",
          "route_template",
          "status_code",
          "duration_ms",
          "actor_kind",
          "project_id",
          "run_id",
          "job_id",
          "replayed",
          "error_code"
        ],
        "additionalProperties": false
      },
      "Usage": {
        "type": "object",
        "properties": {
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          },
          "http_requests": {
            "type": "integer",
            "minimum": 0
          },
          "runs": {
            "type": "integer",
            "minimum": 0
          },
          "jobs": {
            "type": "integer",
            "minimum": 0
          },
          "reserved": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "committed": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "unresolved": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "remaining": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "amount_basis": {
            "type": "string",
            "enum": [
              "partner_limit"
            ]
          },
          "billing_mode": {
            "type": "string",
            "enum": [
              "pilot",
              "contract"
            ]
          }
        },
        "required": [
          "period_start",
          "period_end",
          "as_of",
          "http_requests",
          "runs",
          "jobs",
          "reserved",
          "committed",
          "unresolved",
          "remaining",
          "amount_basis",
          "billing_mode"
        ],
        "additionalProperties": false
      },
      "WebhookCreate": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 100
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "run.state_changed",
                "run.review_required",
                "run.result_ready",
                "run.needs_attention"
              ]
            },
            "minItems": 1,
            "maxItems": 4
          }
        },
        "required": [
          "url",
          "project_ids",
          "events"
        ],
        "additionalProperties": false
      },
      "WebhookPatch": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "run.state_changed",
                "run.review_required",
                "run.result_ready",
                "run.needs_attention"
              ]
            },
            "minItems": 1,
            "maxItems": 4
          }
        },
        "additionalProperties": false,
        "description": "Необходимо хотя бы одно поле."
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "run.state_changed",
                "run.review_required",
                "run.result_ready",
                "run.needs_attention"
              ]
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "verified": {
            "type": "boolean"
          },
          "secret_version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "url",
          "project_ids",
          "events",
          "enabled",
          "verified",
          "secret_version",
          "created_at"
        ],
        "additionalProperties": false
      },
      "WebhookIssued": {
        "type": "object",
        "properties": {
          "endpoint": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "project_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "run.state_changed",
                    "run.review_required",
                    "run.result_ready",
                    "run.needs_attention"
                  ]
                }
              },
              "enabled": {
                "type": "boolean"
              },
              "verified": {
                "type": "boolean"
              },
              "secret_version": {
                "type": "integer",
                "minimum": 1
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "url",
              "project_ids",
              "events",
              "enabled",
              "verified",
              "secret_version",
              "created_at"
            ],
            "additionalProperties": false
          },
          "signing_secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "endpoint"
        ],
        "additionalProperties": false
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "endpoint_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "succeeded",
              "retrying",
              "exhausted"
            ]
          },
          "attempt": {
            "type": "integer",
            "minimum": 0
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "endpoint_id",
          "event_id",
          "state",
          "attempt",
          "http_status",
          "next_attempt_at",
          "created_at"
        ],
        "additionalProperties": false
      },
      "Empty": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "CapabilityPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "studio_workflow": {
                  "type": "object",
                  "properties": {
                    "equivalent": {
                      "type": "boolean"
                    },
                    "stages": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "script",
                          "designs",
                          "storyboard",
                          "cut"
                        ]
                      }
                    },
                    "project_access": {
                      "type": "string",
                      "enum": [
                        "read_only",
                        "read_write",
                        "mixed"
                      ]
                    },
                    "gaps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "operations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "path",
                          "enabled"
                        ],
                        "additionalProperties": false
                      },
                      "default": []
                    },
                    "commands": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "default": []
                    },
                    "image_models": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "aspect_ratios": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "image_sizes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "max_reference_images": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "max_variants": {
                            "type": "integer",
                            "exclusiveMinimum": 0
                          }
                        },
                        "required": [
                          "id",
                          "enabled",
                          "aspect_ratios",
                          "image_sizes",
                          "max_reference_images",
                          "max_variants"
                        ],
                        "additionalProperties": false
                      },
                      "default": []
                    }
                  },
                  "required": [
                    "equivalent",
                    "stages",
                    "project_access",
                    "gaps"
                  ],
                  "additionalProperties": false
                },
                "template_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "template_version": {
                  "type": "integer",
                  "minimum": 1
                },
                "enabled": {
                  "type": "boolean"
                },
                "stages": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "output_profiles": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "unsupported_reasons": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "max_shots": {
                  "type": "integer",
                  "minimum": 1
                },
                "max_episode_seconds": {
                  "type": "integer",
                  "minimum": 1
                },
                "upload_mime_types": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "max_upload_bytes": {
                  "type": "integer",
                  "minimum": 1
                },
                "upload_limits": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "job_types": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "analyze_script",
                      "generate_image",
                      "generate_video",
                      "assemble_video"
                    ]
                  }
                },
                "operations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "type",
                      "enabled"
                    ],
                    "additionalProperties": false
                  }
                },
                "image_size": {
                  "type": "string"
                },
                "max_reference_images": {
                  "type": "integer"
                }
              },
              "required": [
                "studio_workflow",
                "template_id",
                "template_version",
                "enabled",
                "stages",
                "output_profiles",
                "unsupported_reasons",
                "max_shots",
                "max_episode_seconds",
                "upload_mime_types",
                "max_upload_bytes"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ProjectPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "active",
                    "archived"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "client_reference": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 128
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "revision",
                "state",
                "created_at",
                "client_reference"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ResourcePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "project_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "content": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "script"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 900000
                            },
                            "source_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "language": {
                              "type": "string",
                              "minLength": 2,
                              "maxLength": 16
                            }
                          },
                          "required": [
                            "language"
                          ],
                          "additionalProperties": false,
                          "description": "Укажите только text или source_asset_id."
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "character"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "scene"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "prop"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "episode"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "script_resource_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "sequence": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "raw_content": {
                              "type": "string",
                              "maxLength": 20000
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            }
                          },
                          "required": [
                            "script_resource_id",
                            "sequence"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "shot"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "episode_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "scene_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "character_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            },
                            "prop_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "video_prompt": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 4000
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sequence": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "duration_seconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            },
                            "selected_image_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "selected_video_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "required": [
                            "episode_id",
                            "description",
                            "duration_seconds"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "project_id",
                "revision",
                "content",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "RunPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "project_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "plan_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "version": {
                  "type": "integer",
                  "minimum": 1
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "awaiting_review",
                    "stopping",
                    "paused",
                    "needs_attention",
                    "partially_succeeded",
                    "succeeded",
                    "failed",
                    "cancelled"
                  ]
                },
                "client_reference": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 128
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "completed_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "budget_remaining": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "micro_units": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    }
                  },
                  "required": [
                    "currency",
                    "micro_units"
                  ],
                  "additionalProperties": false
                },
                "committed_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "unresolved_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "output_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              },
              "required": [
                "id",
                "project_id",
                "plan_id",
                "version",
                "state",
                "client_reference",
                "created_at",
                "completed_at",
                "budget_remaining",
                "committed_cost",
                "unresolved_cost",
                "output_asset_ids"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "StepPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "run_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "stage_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "target_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "job_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "blocked",
                    "ready",
                    "queued",
                    "running",
                    "awaiting_review",
                    "succeeded",
                    "failed",
                    "cancelled",
                    "unknown"
                  ]
                },
                "output_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "error_code": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ordinal": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "run_id",
                "stage_key",
                "target_id",
                "job_id",
                "state",
                "output_asset_ids",
                "error_code",
                "ordinal"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "RunEventPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "event_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "run_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "sequence": {
                  "type": "integer",
                  "minimum": 1
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "run.state_changed",
                    "run.review_required",
                    "run.result_ready",
                    "run.needs_attention"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "awaiting_review",
                    "stopping",
                    "paused",
                    "needs_attention",
                    "partially_succeeded",
                    "succeeded",
                    "failed",
                    "cancelled"
                  ]
                },
                "step_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "event_id",
                "run_id",
                "sequence",
                "type",
                "state",
                "step_id",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "RequestLogPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "request_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST",
                    "PATCH",
                    "PUT"
                  ]
                },
                "route_template": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "status_code": {
                  "type": "integer",
                  "minimum": 100,
                  "maximum": 599
                },
                "duration_ms": {
                  "type": "integer",
                  "minimum": 0
                },
                "actor_kind": {
                  "type": "string",
                  "enum": [
                    "api_key",
                    "console"
                  ]
                },
                "project_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "run_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "job_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "replayed": {
                  "type": "boolean"
                },
                "error_code": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "request_id",
                "created_at",
                "method",
                "route_template",
                "status_code",
                "duration_ms",
                "actor_kind",
                "project_id",
                "run_id",
                "job_id",
                "replayed",
                "error_code"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "project_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "events": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "run.state_changed",
                      "run.review_required",
                      "run.result_ready",
                      "run.needs_attention"
                    ]
                  }
                },
                "enabled": {
                  "type": "boolean"
                },
                "verified": {
                  "type": "boolean"
                },
                "secret_version": {
                  "type": "integer",
                  "minimum": 1
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "url",
                "project_ids",
                "events",
                "enabled",
                "verified",
                "secret_version",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WebhookDeliveryPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "endpoint_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "event_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "sending",
                    "succeeded",
                    "retrying",
                    "exhausted"
                  ]
                },
                "attempt": {
                  "type": "integer",
                  "minimum": 0
                },
                "http_status": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "next_attempt_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "endpoint_id",
                "event_id",
                "state",
                "attempt",
                "http_status",
                "next_attempt_at",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ArchiveImport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "deferred",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "progress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "phase": {
                    "type": "string",
                    "enum": [
                      "extracting",
                      "importing"
                    ]
                  },
                  "current": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "phase",
                  "current",
                  "total"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "imported": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "work_id",
          "state",
          "progress",
          "imported",
          "failed",
          "asset_ids",
          "error_code"
        ],
        "additionalProperties": false
      },
      "Episode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "title": {
            "type": "string"
          },
          "raw_content": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "number",
          "title",
          "raw_content",
          "description"
        ],
        "additionalProperties": false
      },
      "Scene": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "episode_id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "heading": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_prompt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "episode_id",
          "number",
          "heading",
          "description",
          "video_prompt"
        ],
        "additionalProperties": false
      },
      "EpisodePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "title": {
                  "type": "string"
                },
                "raw_content": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "number",
                "title",
                "raw_content",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ScenePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "episode_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "heading": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "video_prompt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "episode_id",
                "number",
                "heading",
                "description",
                "video_prompt"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "Reference": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "character",
              "scene",
              "prop",
              "grid"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primary_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "description",
          "tags",
          "primary_asset_id"
        ],
        "additionalProperties": false
      },
      "ReferencePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "character",
                    "scene",
                    "prop",
                    "grid"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "primary_asset_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "description",
                "tags",
                "primary_asset_id"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "UploadBatch": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "filename": {
                  "type": "string"
                },
                "ticket": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "asset_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "upload_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "method": {
                      "type": "string",
                      "enum": [
                        "PUT"
                      ]
                    },
                    "content_type": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "asset_id",
                    "upload_url",
                    "method",
                    "content_type",
                    "expires_at"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "filename",
                "ticket"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "project_id",
          "items"
        ],
        "additionalProperties": false
      },
      "listCharactersInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getCharacterInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createCharacterInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "updateCharacterInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "deleteCharacterInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "setCharacterImageInput": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "current_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "asset_id",
          "current_asset_id",
          "revision"
        ],
        "additionalProperties": false
      },
      "generateCharacterImageInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "image-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "aspect_ratio": {
            "type": "string",
            "pattern": "^(auto|[1-9]\\d*:[1-9]\\d*)$"
          },
          "image_size": {
            "type": "string",
            "maxLength": 40
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 16,
            "default": []
          },
          "slot": {
            "type": "string",
            "enum": [
              "primary",
              "variant"
            ],
            "default": "primary"
          },
          "variant_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "current_asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "attachSceneCharacterInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "detachSceneCharacterInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "listBackgroundScenesInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getBackgroundSceneInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createBackgroundSceneInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "updateBackgroundSceneInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "deleteBackgroundSceneInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "setBackgroundSceneImageInput": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "current_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "asset_id",
          "current_asset_id",
          "revision"
        ],
        "additionalProperties": false
      },
      "generateBackgroundSceneImageInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "image-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "aspect_ratio": {
            "type": "string",
            "pattern": "^(auto|[1-9]\\d*:[1-9]\\d*)$"
          },
          "image_size": {
            "type": "string",
            "maxLength": 40
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 16,
            "default": []
          },
          "slot": {
            "type": "string",
            "enum": [
              "primary",
              "variant"
            ],
            "default": "primary"
          },
          "variant_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "current_asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "attachSceneBackgroundSceneInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "detachSceneBackgroundSceneInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "listPropsInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getPropInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createPropInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "updatePropInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "deletePropInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "setPropImageInput": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "current_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "asset_id",
          "current_asset_id",
          "revision"
        ],
        "additionalProperties": false
      },
      "generatePropImageInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "image-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "aspect_ratio": {
            "type": "string",
            "pattern": "^(auto|[1-9]\\d*:[1-9]\\d*)$"
          },
          "image_size": {
            "type": "string",
            "maxLength": 40
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 16,
            "default": []
          },
          "slot": {
            "type": "string",
            "enum": [
              "primary",
              "variant"
            ],
            "default": "primary"
          },
          "variant_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "current_asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "attachScenePropInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "detachScenePropInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "listGridsInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getGridInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createGridInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "updateGridInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "deleteGridInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "setGridImageInput": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "current_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "asset_id",
          "current_asset_id",
          "revision"
        ],
        "additionalProperties": false
      },
      "generateGridImageInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "image-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "aspect_ratio": {
            "type": "string",
            "pattern": "^(auto|[1-9]\\d*:[1-9]\\d*)$"
          },
          "image_size": {
            "type": "string",
            "maxLength": 40
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 16,
            "default": []
          },
          "slot": {
            "type": "string",
            "enum": [
              "primary",
              "variant"
            ],
            "default": "primary"
          },
          "variant_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "current_asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "attachSceneGridInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "detachSceneGridInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "listEpisodesInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getEpisodeInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "listScenesInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getSceneInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createArchiveImportInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision",
          "asset_id"
        ],
        "additionalProperties": false
      },
      "getArchiveImportInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createWorkUploadsInput": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "filename": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[^\\\\/\\x00-\\x1f]+$"
                },
                "mime_type": {
                  "type": "string",
                  "enum": [
                    "text/plain",
                    "text/markdown",
                    "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                    "image/png",
                    "image/jpeg",
                    "image/webp",
                    "image/avif",
                    "audio/wav",
                    "application/zip"
                  ]
                },
                "size_bytes": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 1073741824
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              },
              "required": [
                "filename",
                "mime_type",
                "size_bytes",
                "sha256"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 20
          }
        },
        "required": [
          "files"
        ],
        "additionalProperties": false
      },
      "updateEpisodeInput": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "raw_content": {
            "type": "string",
            "maxLength": 20000
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "title",
          "revision"
        ],
        "additionalProperties": false
      },
      "deleteEpisodeInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "updateSceneInput": {
        "type": "object",
        "properties": {
          "heading": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "video_prompt": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "heading",
          "revision"
        ],
        "additionalProperties": false
      },
      "deleteSceneInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "reorderScenesInput": {
        "type": "object",
        "properties": {
          "scene_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1,
            "maxItems": 500
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "scene_ids",
          "revision"
        ],
        "additionalProperties": false
      },
      "createEpisodeInput": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "raw_content": {
            "type": "string",
            "maxLength": 20000
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "title",
          "revision"
        ],
        "additionalProperties": false
      },
      "createSceneInput": {
        "type": "object",
        "properties": {
          "heading": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "video_prompt": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "heading",
          "revision"
        ],
        "additionalProperties": false
      },
      "saveScriptInput": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 5000000
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "text",
          "revision"
        ],
        "additionalProperties": false
      },
      "generateSceneVideoInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "anchor_asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 12
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "video-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "duration_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          },
          "resolution": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "aspect_ratio": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "generate_audio": {
            "type": "boolean"
          }
        },
        "required": [
          "revision",
          "duration_seconds",
          "resolution",
          "aspect_ratio"
        ],
        "additionalProperties": false
      },
      "selectSceneTakeInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "take_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "revision",
          "take_id"
        ],
        "additionalProperties": false
      },
      "exportWorkInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "allow_partial": {
            "type": "boolean",
            "default": true
          },
          "selections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "scene_id",
                "asset_id"
              ],
              "additionalProperties": false
            },
            "maxItems": 200
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "StudioBuildProgress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_version": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "wait_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "stage": {
            "type": [
              "string",
              "null"
            ]
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "assistant",
                    "system_note"
                  ]
                },
                "stage": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "content": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "streaming",
                    "final"
                  ]
                },
                "seq": {
                  "type": "number"
                },
                "created_at": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "stage",
                "content",
                "status",
                "seq",
                "created_at",
                "updated_at"
              ],
              "additionalProperties": false
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "filterMode": {
                  "type": "string",
                  "enum": [
                    "prompt_index",
                    "full_text"
                  ]
                },
                "sourceText": {
                  "type": "string"
                },
                "llmText": {
                  "type": "string"
                },
                "originalChars": {
                  "type": "number"
                },
                "preparedChars": {
                  "type": "number"
                }
              },
              "required": [
                "id",
                "name",
                "filterMode",
                "sourceText",
                "llmText",
                "originalChars",
                "preparedChars"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "state",
          "stage",
          "messages",
          "sources"
        ],
        "additionalProperties": false
      },
      "StudioDraft": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "instructions": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8000
          },
          "source_text": {
            "type": "string",
            "maxLength": 50000
          },
          "max_output_tokens": {
            "type": "integer",
            "minimum": 256,
            "maximum": 8192,
            "default": 2048
          }
        },
        "required": [
          "revision",
          "instructions"
        ],
        "additionalProperties": false
      },
      "StudioImport": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision",
          "asset_id"
        ],
        "additionalProperties": false
      },
      "StudioLibrary": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "media_type": {
                  "type": "string"
                },
                "mime": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "is_current_version": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "kind",
                "media_type",
                "mime",
                "version",
                "is_current_version"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "StudioCommand": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.asset.set"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "primary",
                      "variant"
                    ]
                  },
                  "current_asset_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "id",
                  "asset_id",
                  "kind",
                  "current_asset_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "asset.delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "trash.restore"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "entity_type": {
                    "type": "string",
                    "enum": [
                      "asset",
                      "design"
                    ]
                  }
                },
                "required": [
                  "id",
                  "entity_type"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.duplicate"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "project.settings.update"
              },
              "input": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 24
                    },
                    "maxItems": 8
                  },
                  "cover": {
                    "type": "string",
                    "enum": [
                      "amber",
                      "indigo",
                      "teal",
                      "rust",
                      "moss",
                      "ink",
                      "sage",
                      "bone",
                      "wine",
                      "wash",
                      "blush",
                      "void"
                    ]
                  },
                  "aspect": {
                    "type": "string",
                    "enum": [
                      "16:9",
                      "9:16",
                      "1:1",
                      "4:3",
                      "21:9"
                    ]
                  },
                  "resolution": {
                    "type": "string",
                    "enum": [
                      "480p",
                      "720p",
                      "1080p",
                      "2k"
                    ]
                  },
                  "style": {
                    "type": "string",
                    "enum": [
                      "realistic_general",
                      "realistic_urban",
                      "realistic_cinematic",
                      "2d_japanese_manga",
                      "2d_korean_urban",
                      "2d_korean",
                      "2d_otome",
                      "2d_chinese_manga",
                      "2d_classical",
                      "3d_chinese",
                      "3d_xianxia",
                      "3d_cartoon",
                      "cg_general",
                      "cg_cyberpunk",
                      "ink_gongbi",
                      "custom"
                    ]
                  },
                  "style_prompt": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "title",
                  "tags",
                  "cover",
                  "aspect",
                  "resolution",
                  "style",
                  "style_prompt"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "project.rename"
              },
              "input": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "title"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "project.state.set"
              },
              "input": {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "active",
                      "archived"
                    ]
                  }
                },
                "required": [
                  "state"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "script.update"
              },
              "input": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 5000000
                  }
                },
                "required": [
                  "text"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "script.bible.update"
              },
              "input": {
                "type": "object",
                "properties": {
                  "logline": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "synopsis": {
                    "type": "string",
                    "maxLength": 4000
                  }
                },
                "required": [
                  "logline",
                  "synopsis"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "episode.save"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "number": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "raw_content": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  }
                },
                "required": [
                  "title"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "episode.delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.save"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "episode_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "heading": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "number": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "video_prompt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "episode_id",
                  "heading"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.reorder"
              },
              "input": {
                "type": "object",
                "properties": {
                  "episode_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "scene_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "minItems": 1,
                    "maxItems": 500
                  }
                },
                "required": [
                  "episode_id",
                  "scene_ids"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.save"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "character",
                      "scene",
                      "prop",
                      "grid"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "maxItems": 8
                  }
                },
                "required": [
                  "kind",
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.voice.set"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "asset_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.asset.detach"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "primary",
                      "variant",
                      "voice"
                    ]
                  }
                },
                "required": [
                  "id",
                  "asset_id",
                  "kind"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.asset.restore"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "current_asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "restore_asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "primary",
                      "variant"
                    ]
                  }
                },
                "required": [
                  "id",
                  "current_asset_id",
                  "restore_asset_id",
                  "kind"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.variant.rename"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "id",
                  "asset_id",
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.design.attach"
              },
              "input": {
                "type": "object",
                "properties": {
                  "scene_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "design_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "scene_id",
                  "design_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.design.detach"
              },
              "input": {
                "type": "object",
                "properties": {
                  "scene_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "design_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "scene_id",
                  "design_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "cut.take.select"
              },
              "input": {
                "type": "object",
                "properties": {
                  "scene_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "scene_id",
                  "asset_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "take.delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "scene_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "scene_id",
                  "asset_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          }
        ]
      },
      "StudioMutation": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "changed_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "studio_url": {
            "type": "string"
          }
        },
        "required": [
          "project_id",
          "changed_id",
          "revision",
          "studio_url"
        ],
        "additionalProperties": false
      },
      "StudioWorkflow": {
        "type": "object",
        "properties": {
          "api_runs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string"
                },
                "completed_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "total_steps": {
                  "type": "integer",
                  "minimum": 0
                },
                "completed_steps": {
                  "type": "integer",
                  "minimum": 0
                },
                "error_code": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "state",
                "created_at",
                "completed_at",
                "total_steps",
                "completed_steps",
                "error_code"
              ],
              "additionalProperties": false
            }
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "studio_url": {
            "type": "string"
          },
          "trash": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "entity_type": {
                  "type": "string",
                  "enum": [
                    "asset",
                    "design"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "deleted_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "entity_type",
                "name",
                "deleted_at"
              ],
              "additionalProperties": false
            }
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "media_type": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "mime": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "lineage_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "is_current_version": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "kind",
                "media_type",
                "status",
                "mime",
                "lineage_id",
                "version",
                "is_current_version"
              ],
              "additionalProperties": false
            }
          },
          "settings": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "cover": {
                "type": "string"
              },
              "aspect": {
                "type": "string"
              },
              "resolution": {
                "type": "string"
              },
              "style": {
                "type": "string"
              },
              "style_prompt": {
                "type": "string"
              },
              "state": {
                "type": "string"
              }
            },
            "required": [
              "title",
              "tags",
              "cover",
              "aspect",
              "resolution",
              "style",
              "style_prompt",
              "state"
            ],
            "additionalProperties": false
          },
          "script": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "logline": {
                "type": "string"
              },
              "synopsis": {
                "type": "string"
              }
            },
            "required": [
              "text",
              "logline",
              "synopsis"
            ],
            "additionalProperties": false
          },
          "episodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "title": {
                  "type": "string"
                },
                "raw_content": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "number",
                "title",
                "raw_content",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "designs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "character",
                    "scene",
                    "prop",
                    "grid"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "primary_asset_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "description",
                "tags",
                "primary_asset_id"
              ],
              "additionalProperties": false
            }
          },
          "scenes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "episode_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "heading": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "video_prompt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "episode_id",
                "number",
                "heading",
                "description",
                "video_prompt"
              ],
              "additionalProperties": false
            }
          },
          "scene_designs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "design_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "scene_id",
                "design_id",
                "kind",
                "position"
              ],
              "additionalProperties": false
            }
          },
          "takes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "scene_id",
                "asset_id",
                "position"
              ],
              "additionalProperties": false
            }
          },
          "cut_selections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "scene_id",
                "asset_id"
              ],
              "additionalProperties": false
            }
          },
          "design_assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "design_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "design_id",
                "asset_id",
                "kind",
                "name",
                "position"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "api_runs",
          "project_id",
          "revision",
          "studio_url",
          "trash",
          "assets",
          "settings",
          "script",
          "episodes",
          "designs",
          "scenes",
          "scene_designs",
          "takes",
          "cut_selections",
          "design_assets"
        ],
        "additionalProperties": false
      },
      "StudioAnalysis": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "script_text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000000
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "StudioBuild": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "script_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "default": []
          },
          "material_scope": {
            "type": "string",
            "enum": [
              "unclassified",
              "all"
            ],
            "default": "unclassified"
          },
          "preprocess": {
            "type": "object",
            "properties": {
              "ignoreAttachments": {
                "type": "boolean",
                "default": true
              },
              "discardKeywords": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "maxItems": 100,
                "default": [
                  "提示词",
                  "prompt",
                  "Midjourney",
                  "Stable Diffusion",
                  "DALL-E",
                  "Image1",
                  "Image2",
                  "正向提示词",
                  "负向提示词",
                  "视觉描述",
                  "出图要求",
                  "技术规格",
                  "画面描述",
                  "镜头提示词",
                  "请生成",
                  "角色三视图",
                  "服装本体展示",
                  "局部材质与细节放大"
                ]
              },
              "keepLabels": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "maxItems": 100,
                "default": [
                  "资产名称",
                  "资产ID",
                  "资产版本",
                  "关联角色资产名称",
                  "关联角色资产ID",
                  "关联场景资产名称",
                  "关联场景资产ID",
                  "关联道具资产名称",
                  "关联道具资产ID",
                  "服装变体ID",
                  "服装名称",
                  "道具资产ID",
                  "道具名称",
                  "场景资产ID",
                  "场景名称",
                  "宫格图ID",
                  "集数",
                  "主题",
                  "场景",
                  "角色名称",
                  "用途"
                ]
              }
            },
            "additionalProperties": false
          },
          "rebuild_policy": {
            "type": "string",
            "const": "full_rebuild"
          }
        },
        "required": [
          "revision",
          "rebuild_policy"
        ],
        "additionalProperties": false
      },
      "StudioCutExport": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "allow_partial": {
            "type": "boolean",
            "default": true
          },
          "selections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "scene_id",
                "asset_id"
              ],
              "additionalProperties": false
            },
            "maxItems": 200
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "StudioVideo": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "scene_id": {
            "type": "string",
            "format": "uuid"
          },
          "anchor_asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 12
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "video-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "duration_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          },
          "resolution": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "aspect_ratio": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "generate_audio": {
            "type": "boolean"
          }
        },
        "required": [
          "revision",
          "scene_id",
          "duration_seconds",
          "resolution",
          "aspect_ratio"
        ],
        "additionalProperties": false
      },
      "StudioImage": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "design_id": {
            "type": "string",
            "format": "uuid"
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "image-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "aspect_ratio": {
            "type": "string",
            "pattern": "^(auto|[1-9]\\d*:[1-9]\\d*)$"
          },
          "image_size": {
            "type": "string",
            "maxLength": 40
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 16,
            "default": []
          },
          "slot": {
            "type": "string",
            "enum": [
              "primary",
              "variant"
            ],
            "default": "primary"
          },
          "variant_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "current_asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision",
          "design_id"
        ],
        "additionalProperties": false
      },
      "Uploaded": {
        "type": "object",
        "properties": {
          "uploaded": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "uploaded"
        ],
        "additionalProperties": false
      },
      "PublicCapabilityPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "studio_workflow": {
                  "type": "object",
                  "properties": {
                    "equivalent": {
                      "type": "boolean"
                    },
                    "stages": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "script",
                          "designs",
                          "storyboard",
                          "cut"
                        ]
                      }
                    },
                    "project_access": {
                      "type": "string",
                      "enum": [
                        "read_only",
                        "read_write",
                        "mixed"
                      ]
                    },
                    "gaps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "operations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "path",
                          "enabled"
                        ],
                        "additionalProperties": false
                      },
                      "default": []
                    },
                    "commands": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "default": []
                    },
                    "image_models": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "aspect_ratios": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "image_sizes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "max_reference_images": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "max_variants": {
                            "type": "integer",
                            "exclusiveMinimum": 0
                          }
                        },
                        "required": [
                          "id",
                          "enabled",
                          "aspect_ratios",
                          "image_sizes",
                          "max_reference_images",
                          "max_variants"
                        ],
                        "additionalProperties": false
                      },
                      "default": []
                    }
                  },
                  "required": [
                    "equivalent",
                    "stages",
                    "project_access",
                    "gaps"
                  ],
                  "additionalProperties": false
                },
                "template_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "template_version": {
                  "type": "integer",
                  "minimum": 1
                },
                "enabled": {
                  "type": "boolean"
                },
                "stages": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "output_profiles": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "unsupported_reasons": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "max_shots": {
                  "type": "integer",
                  "minimum": 1
                },
                "max_episode_seconds": {
                  "type": "integer",
                  "minimum": 1
                },
                "upload_mime_types": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "max_upload_bytes": {
                  "type": "integer",
                  "minimum": 1
                },
                "upload_limits": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "job_types": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "analyze_script",
                      "generate_image",
                      "generate_video",
                      "assemble_video"
                    ]
                  }
                },
                "operations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "type",
                      "enabled"
                    ],
                    "additionalProperties": false
                  }
                },
                "image_size": {
                  "type": "string"
                },
                "max_reference_images": {
                  "type": "integer"
                }
              },
              "required": [
                "studio_workflow",
                "template_id",
                "template_version",
                "enabled",
                "stages",
                "output_profiles",
                "unsupported_reasons",
                "max_shots",
                "max_episode_seconds",
                "upload_mime_types",
                "max_upload_bytes"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicProjectPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "active",
                    "archived"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "client_reference": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 128
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "revision",
                "state",
                "created_at",
                "client_reference"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicProject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "client_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "revision",
          "state",
          "created_at",
          "client_reference"
        ],
        "additionalProperties": false
      },
      "PublicResourcePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "work_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "content": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "script"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 900000
                            },
                            "source_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "language": {
                              "type": "string",
                              "minLength": 2,
                              "maxLength": 16
                            }
                          },
                          "required": [
                            "language"
                          ],
                          "additionalProperties": false,
                          "description": "Укажите только text или source_asset_id."
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "character"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "scene"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "prop"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "episode"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "script_resource_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "sequence": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "raw_content": {
                              "type": "string",
                              "maxLength": 20000
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            }
                          },
                          "required": [
                            "script_resource_id",
                            "sequence"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "shot"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "episode_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "scene_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "character_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            },
                            "prop_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "video_prompt": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 4000
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sequence": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "duration_seconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            },
                            "selected_image_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "selected_video_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "required": [
                            "episode_id",
                            "description",
                            "duration_seconds"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "work_id",
                "revision",
                "content",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicResource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "content": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "script"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 900000
                      },
                      "source_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "language": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 16
                      }
                    },
                    "required": [
                      "language"
                    ],
                    "additionalProperties": false,
                    "description": "Укажите только text или source_asset_id."
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "character"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "scene"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "prop"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "episode"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "script_resource_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "sequence": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "raw_content": {
                        "type": "string",
                        "maxLength": 20000
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      }
                    },
                    "required": [
                      "script_resource_id",
                      "sequence"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "shot"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "episode_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "scene_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "character_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      },
                      "prop_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "video_prompt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 4000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sequence": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "duration_seconds": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      },
                      "selected_image_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "selected_video_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "episode_id",
                      "description",
                      "duration_seconds"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "work_id",
          "revision",
          "content",
          "created_at"
        ],
        "additionalProperties": false
      },
      "PublicUploadTicket": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "upload_url": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "content_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "asset_id",
          "upload_url",
          "method",
          "content_type",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "PublicAsset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "ready",
              "errored",
              "expired"
            ]
          },
          "mime_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "download_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "work_id",
          "state",
          "mime_type",
          "size_bytes",
          "download_url",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "PublicPlan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "project_revision": {
            "type": "integer",
            "minimum": 1
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "template_version": {
            "type": "integer",
            "minimum": 1
          },
          "executable": {
            "type": "boolean"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "budget_ceiling": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "stage_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "target_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "depends_on": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "requires_review": {
                  "type": "boolean"
                },
                "max_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "stage_key",
                "target_ids",
                "depends_on",
                "requires_review",
                "max_cost"
              ],
              "additionalProperties": false
            }
          },
          "unsupported_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          }
        },
        "required": [
          "id",
          "work_id",
          "project_revision",
          "template_id",
          "template_version",
          "executable",
          "expires_at",
          "budget_ceiling",
          "steps",
          "unsupported_reasons"
        ],
        "additionalProperties": false
      },
      "PublicRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "plan_id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "awaiting_review",
              "stopping",
              "paused",
              "needs_attention",
              "partially_succeeded",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "client_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "budget_remaining": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "committed_cost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "unresolved_cost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "output_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "id",
          "work_id",
          "plan_id",
          "version",
          "state",
          "client_reference",
          "created_at",
          "completed_at",
          "budget_remaining",
          "committed_cost",
          "unresolved_cost",
          "output_asset_ids"
        ],
        "additionalProperties": false
      },
      "PublicRunPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "work_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "plan_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "version": {
                  "type": "integer",
                  "minimum": 1
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "awaiting_review",
                    "stopping",
                    "paused",
                    "needs_attention",
                    "partially_succeeded",
                    "succeeded",
                    "failed",
                    "cancelled"
                  ]
                },
                "client_reference": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 128
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "completed_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "budget_remaining": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "micro_units": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    }
                  },
                  "required": [
                    "currency",
                    "micro_units"
                  ],
                  "additionalProperties": false
                },
                "committed_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "unresolved_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "output_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              },
              "required": [
                "id",
                "work_id",
                "plan_id",
                "version",
                "state",
                "client_reference",
                "created_at",
                "completed_at",
                "budget_remaining",
                "committed_cost",
                "unresolved_cost",
                "output_asset_ids"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicStepPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "run_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "stage_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "target_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "job_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "blocked",
                    "ready",
                    "queued",
                    "running",
                    "awaiting_review",
                    "succeeded",
                    "failed",
                    "cancelled",
                    "unknown"
                  ]
                },
                "output_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "error_code": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ordinal": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "run_id",
                "stage_key",
                "target_id",
                "job_id",
                "state",
                "output_asset_ids",
                "error_code",
                "ordinal"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicRunEventPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "event_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "run_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "sequence": {
                  "type": "integer",
                  "minimum": 1
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "run.state_changed",
                    "run.review_required",
                    "run.result_ready",
                    "run.needs_attention"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "awaiting_review",
                    "stopping",
                    "paused",
                    "needs_attention",
                    "partially_succeeded",
                    "succeeded",
                    "failed",
                    "cancelled"
                  ]
                },
                "step_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "event_id",
                "run_id",
                "sequence",
                "type",
                "state",
                "step_id",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicJob": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "ready",
              "blocked",
              "processing",
              "awaiting_review",
              "succeeded",
              "failed",
              "cancelled",
              "needs_review"
            ]
          },
          "output_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "resource_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "skipped_scene_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "id",
          "work_id",
          "run_id",
          "state",
          "output_asset_ids",
          "error_code"
        ],
        "additionalProperties": false
      },
      "PublicRequestLogPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "request_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST",
                    "PATCH",
                    "PUT"
                  ]
                },
                "route_template": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "status_code": {
                  "type": "integer",
                  "minimum": 100,
                  "maximum": 599
                },
                "duration_ms": {
                  "type": "integer",
                  "minimum": 0
                },
                "actor_kind": {
                  "type": "string",
                  "enum": [
                    "api_key",
                    "console"
                  ]
                },
                "work_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "run_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "job_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "replayed": {
                  "type": "boolean"
                },
                "error_code": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "request_id",
                "created_at",
                "method",
                "route_template",
                "status_code",
                "duration_ms",
                "actor_kind",
                "work_id",
                "run_id",
                "job_id",
                "replayed",
                "error_code"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicRequestLog": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST",
              "PATCH",
              "PUT"
            ]
          },
          "route_template": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "status_code": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          },
          "actor_kind": {
            "type": "string",
            "enum": [
              "api_key",
              "console"
            ]
          },
          "work_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "job_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "replayed": {
            "type": "boolean"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "request_id",
          "created_at",
          "method",
          "route_template",
          "status_code",
          "duration_ms",
          "actor_kind",
          "work_id",
          "run_id",
          "job_id",
          "replayed",
          "error_code"
        ],
        "additionalProperties": false
      },
      "PublicUsage": {
        "type": "object",
        "properties": {
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          },
          "http_requests": {
            "type": "integer",
            "minimum": 0
          },
          "runs": {
            "type": "integer",
            "minimum": 0
          },
          "jobs": {
            "type": "integer",
            "minimum": 0
          },
          "reserved": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "committed": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "unresolved": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "remaining": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "amount_basis": {
            "type": "string",
            "enum": [
              "partner_limit"
            ]
          },
          "billing_mode": {
            "type": "string",
            "enum": [
              "pilot",
              "contract"
            ]
          }
        },
        "required": [
          "period_start",
          "period_end",
          "as_of",
          "http_requests",
          "runs",
          "jobs",
          "reserved",
          "committed",
          "unresolved",
          "remaining",
          "amount_basis",
          "billing_mode"
        ],
        "additionalProperties": false
      },
      "PublicWebhookEndpointPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "work_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "events": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "run.state_changed",
                      "run.review_required",
                      "run.result_ready",
                      "run.needs_attention"
                    ]
                  }
                },
                "enabled": {
                  "type": "boolean"
                },
                "verified": {
                  "type": "boolean"
                },
                "secret_version": {
                  "type": "integer",
                  "minimum": 1
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "url",
                "work_ids",
                "events",
                "enabled",
                "verified",
                "secret_version",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicWebhookIssued": {
        "type": "object",
        "properties": {
          "endpoint": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "work_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "run.state_changed",
                    "run.review_required",
                    "run.result_ready",
                    "run.needs_attention"
                  ]
                }
              },
              "enabled": {
                "type": "boolean"
              },
              "verified": {
                "type": "boolean"
              },
              "secret_version": {
                "type": "integer",
                "minimum": 1
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "url",
              "work_ids",
              "events",
              "enabled",
              "verified",
              "secret_version",
              "created_at"
            ],
            "additionalProperties": false
          },
          "signing_secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "endpoint"
        ],
        "additionalProperties": false
      },
      "PublicWebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "work_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "run.state_changed",
                "run.review_required",
                "run.result_ready",
                "run.needs_attention"
              ]
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "verified": {
            "type": "boolean"
          },
          "secret_version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "url",
          "work_ids",
          "events",
          "enabled",
          "verified",
          "secret_version",
          "created_at"
        ],
        "additionalProperties": false
      },
      "PublicWebhookDeliveryPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "endpoint_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "event_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "sending",
                    "succeeded",
                    "retrying",
                    "exhausted"
                  ]
                },
                "attempt": {
                  "type": "integer",
                  "minimum": 0
                },
                "http_status": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "next_attempt_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "endpoint_id",
                "event_id",
                "state",
                "attempt",
                "http_status",
                "next_attempt_at",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicWebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "endpoint_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "succeeded",
              "retrying",
              "exhausted"
            ]
          },
          "attempt": {
            "type": "integer",
            "minimum": 0
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "endpoint_id",
          "event_id",
          "state",
          "attempt",
          "http_status",
          "next_attempt_at",
          "created_at"
        ],
        "additionalProperties": false
      },
      "PublicUploaded": {
        "type": "object",
        "properties": {
          "uploaded": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "uploaded"
        ],
        "additionalProperties": false
      },
      "PublicStudioWorkflow": {
        "type": "object",
        "properties": {
          "api_runs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string"
                },
                "completed_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "total_steps": {
                  "type": "integer",
                  "minimum": 0
                },
                "completed_steps": {
                  "type": "integer",
                  "minimum": 0
                },
                "error_code": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "state",
                "created_at",
                "completed_at",
                "total_steps",
                "completed_steps",
                "error_code"
              ],
              "additionalProperties": false
            }
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "studio_url": {
            "type": "string"
          },
          "trash": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "entity_type": {
                  "type": "string",
                  "enum": [
                    "asset",
                    "design"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "deleted_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "entity_type",
                "name",
                "deleted_at"
              ],
              "additionalProperties": false
            }
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "media_type": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "mime": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "lineage_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "is_current_version": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "kind",
                "media_type",
                "status",
                "mime",
                "lineage_id",
                "version",
                "is_current_version"
              ],
              "additionalProperties": false
            }
          },
          "settings": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "cover": {
                "type": "string"
              },
              "aspect": {
                "type": "string"
              },
              "resolution": {
                "type": "string"
              },
              "style": {
                "type": "string"
              },
              "style_prompt": {
                "type": "string"
              },
              "state": {
                "type": "string"
              }
            },
            "required": [
              "title",
              "tags",
              "cover",
              "aspect",
              "resolution",
              "style",
              "style_prompt",
              "state"
            ],
            "additionalProperties": false
          },
          "script": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "logline": {
                "type": "string"
              },
              "synopsis": {
                "type": "string"
              }
            },
            "required": [
              "text",
              "logline",
              "synopsis"
            ],
            "additionalProperties": false
          },
          "episodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "title": {
                  "type": "string"
                },
                "raw_content": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "number",
                "title",
                "raw_content",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "designs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "character",
                    "scene",
                    "prop",
                    "grid"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "primary_asset_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "description",
                "tags",
                "primary_asset_id"
              ],
              "additionalProperties": false
            }
          },
          "scenes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "episode_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "heading": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "video_prompt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "episode_id",
                "number",
                "heading",
                "description",
                "video_prompt"
              ],
              "additionalProperties": false
            }
          },
          "scene_designs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "design_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "scene_id",
                "design_id",
                "kind",
                "position"
              ],
              "additionalProperties": false
            }
          },
          "takes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "scene_id",
                "asset_id",
                "position"
              ],
              "additionalProperties": false
            }
          },
          "cut_selections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "scene_id",
                "asset_id"
              ],
              "additionalProperties": false
            }
          },
          "design_assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "design_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "design_id",
                "asset_id",
                "kind",
                "name",
                "position"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "api_runs",
          "work_id",
          "revision",
          "studio_url",
          "trash",
          "assets",
          "settings",
          "script",
          "episodes",
          "designs",
          "scenes",
          "scene_designs",
          "takes",
          "cut_selections",
          "design_assets"
        ],
        "additionalProperties": false
      },
      "PublicStudioMutation": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "changed_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "studio_url": {
            "type": "string"
          }
        },
        "required": [
          "work_id",
          "changed_id",
          "revision",
          "studio_url"
        ],
        "additionalProperties": false
      },
      "PublicStudioLibrary": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "media_type": {
                  "type": "string"
                },
                "mime": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "is_current_version": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "kind",
                "media_type",
                "mime",
                "version",
                "is_current_version"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicStudioBuildProgress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_version": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "wait_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "stage": {
            "type": [
              "string",
              "null"
            ]
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "assistant",
                    "system_note"
                  ]
                },
                "stage": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "content": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "streaming",
                    "final"
                  ]
                },
                "seq": {
                  "type": "number"
                },
                "created_at": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "stage",
                "content",
                "status",
                "seq",
                "created_at",
                "updated_at"
              ],
              "additionalProperties": false
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "filterMode": {
                  "type": "string",
                  "enum": [
                    "prompt_index",
                    "full_text"
                  ]
                },
                "sourceText": {
                  "type": "string"
                },
                "llmText": {
                  "type": "string"
                },
                "originalChars": {
                  "type": "number"
                },
                "preparedChars": {
                  "type": "number"
                }
              },
              "required": [
                "id",
                "name",
                "filterMode",
                "sourceText",
                "llmText",
                "originalChars",
                "preparedChars"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "state",
          "stage",
          "messages",
          "sources"
        ],
        "additionalProperties": false
      },
      "PublicReferencePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "character",
                    "scene",
                    "prop",
                    "grid"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "primary_asset_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "description",
                "tags",
                "primary_asset_id"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicReference": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "character",
              "scene",
              "prop",
              "grid"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primary_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "description",
          "tags",
          "primary_asset_id"
        ],
        "additionalProperties": false
      },
      "PublicEpisodePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "title": {
                  "type": "string"
                },
                "raw_content": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "number",
                "title",
                "raw_content",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicEpisode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "title": {
            "type": "string"
          },
          "raw_content": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "number",
          "title",
          "raw_content",
          "description"
        ],
        "additionalProperties": false
      },
      "PublicScenePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "episode_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "heading": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "video_prompt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "episode_id",
                "number",
                "heading",
                "description",
                "video_prompt"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicScene": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "episode_id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "heading": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_prompt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "episode_id",
          "number",
          "heading",
          "description",
          "video_prompt"
        ],
        "additionalProperties": false
      },
      "PublicArchiveImport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "deferred",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "progress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "phase": {
                    "type": "string",
                    "enum": [
                      "extracting",
                      "importing"
                    ]
                  },
                  "current": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "phase",
                  "current",
                  "total"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "imported": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "work_id",
          "state",
          "progress",
          "imported",
          "failed",
          "asset_ids",
          "error_code"
        ],
        "additionalProperties": false
      },
      "PublicUploadBatch": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "filename": {
                  "type": "string"
                },
                "ticket": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "asset_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "upload_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "method": {
                      "type": "string",
                      "enum": [
                        "PUT"
                      ]
                    },
                    "content_type": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "asset_id",
                    "upload_url",
                    "method",
                    "content_type",
                    "expires_at"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "filename",
                "ticket"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "work_id",
          "items"
        ],
        "additionalProperties": false
      }
    }
  },
  "x-documentation-language": "ru",
  "tags": [
    {
      "name": "Функции",
      "description": "Функции",
      "x-tag-id": "capabilities"
    },
    {
      "name": "Проекты и ресурсы",
      "description": "Проекты и ресурсы",
      "x-tag-id": "projects"
    },
    {
      "name": "Загрузки",
      "description": "Загрузки",
      "x-tag-id": "uploads"
    },
    {
      "name": "Файлы и результаты",
      "description": "Файлы и результаты",
      "x-tag-id": "assets"
    },
    {
      "name": "Запуски",
      "description": "Запуски",
      "x-tag-id": "runs"
    },
    {
      "name": "Функции процесса",
      "description": "Функции процесса",
      "x-tag-id": "jobs"
    },
    {
      "name": "Журналы запросов",
      "description": "Журналы запросов",
      "x-tag-id": "requests"
    },
    {
      "name": "Использование",
      "description": "Использование",
      "x-tag-id": "usage"
    },
    {
      "name": "Webhook",
      "description": "Webhook",
      "x-tag-id": "webhook-endpoints"
    },
    {
      "name": "Доставки Webhook",
      "description": "Доставки Webhook",
      "x-tag-id": "webhook-deliveries"
    },
    {
      "name": "Спецификация",
      "description": "Спецификация",
      "x-tag-id": "Documentation"
    }
  ]
}
