> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hingnet.com.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 视频 Remix

> 基于现有视频进行二次创作

Remix 功能允许你基于已生成的视频进行二次创作，通过新的提示词修改视频内容。本文只描述公开兼容页面，不承接灰色渠道时长或扩展字段说明。

## 创建 Remix 任务

基于现有视频 ID 和新的提示词创建 Remix 任务：

```bash theme={null}
curl -X POST "https://models.hingnet.com.cn/v1/videos/$VIDEO_ID/remix" \
  -H "Authorization: Bearer $TOKEN" \
  -F "prompt=在结尾添加品牌 Logo"
```

### 请求参数

* `video_id`（路径参数）：原视频任务的唯一标识符
* `prompt`（请求体）：Remix 的文本描述，最多 1000 个字符

### 响应示例

```json theme={null}
{
  "id": "video_def456789abc012345678901234567890123456789",
  "object": "video",
  "created_at": 1762789902,
  "status": "queued",
  "model": "sora-2",
  "prompt": "在结尾添加品牌 Logo",
  "progress": 0,
  "seconds": "8",
  "size": "1280x720",
  "remixed_from_video_id": "video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737"
}
```

## 使用场景

Remix 功能适用于以下场景：

* **添加元素**：在视频中添加 Logo、文字或其他视觉元素
* **调整风格**：改变视频的色调、滤镜或艺术风格
* **修改细节**：调整视频中的特定对象或场景
* **延长内容**：在视频开头或结尾添加新的场景

## 工作流程

1. 首先创建一个基础视频任务
2. 等待基础视频生成完成（status 为 `success`）
3. 使用基础视频的 ID 创建 Remix 任务
4. 查询 Remix 任务状态，等待完成
5. 下载 Remix 后的视频

```bash theme={null}
# 1. 创建基础视频
VIDEO_ID=$(curl -X POST "https://models.hingnet.com.cn/v1/videos" \
  -H "Authorization: Bearer $TOKEN" \
  -F "model=sora-2" \
  -F "prompt=一个无人机从海滩升空" \
  | jq -r '.id')

# 2. 等待完成（轮询查询）
while true; do
  STATUS=$(curl "https://models.hingnet.com.cn/v1/videos/$VIDEO_ID" \
    -H "Authorization: Bearer $TOKEN" | jq -r '.status')
  if [ "$STATUS" = "success" ]; then break; fi
  sleep 5
done

# 3. 创建 Remix
REMIX_ID=$(curl -X POST "https://models.hingnet.com.cn/v1/videos/$VIDEO_ID/remix" \
  -H "Authorization: Bearer $TOKEN" \
  -F "prompt=添加日落滤镜效果" \
  | jq -r '.id')

# 4. 下载 Remix 视频
curl -L "https://models.hingnet.com.cn/v1/videos/$REMIX_ID/content" \
  -H "Authorization: Bearer $TOKEN" \
  --output "remix_$REMIX_ID.mp4"
```

<Callout type="info">
  Remix 任务会继承原视频的基本参数（如分辨率、时长），但会根据新的提示词进行内容调整。若你在平台中同时接入灰色和官方渠道，请按 [Sora 视频路由与分组](/guide/sora-video-routing) 隔离契约边界。
</Callout>

<Callout type="warning">
  原视频必须处于可用终态后才能进行 Remix。当前实现中终态成功值为 `success`。Remix 任务会消耗与创建新视频相同的配额。
</Callout>


## OpenAPI

````yaml POST /v1/videos/{video_id}/remix
openapi: 3.0.0
info:
  title: OpenAI Video API
  description: OpenAI Sora 视频生成 API
  version: 1.0.0
servers:
  - url: https://models.hingnet.com.cn
    description: HingNet 生产环境
security:
  - BearerAuth: []
paths:
  /v1/videos/{video_id}/remix:
    post:
      tags:
        - Videos
      summary: Remix 视频
      description: 基于现有视频进行二次创作
      operationId: remixVideo
      parameters:
        - name: video_id
          in: path
          required: true
          description: 原视频任务的唯一标识符
          schema:
            type: string
          example: video_abc123
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - prompt
              properties:
                prompt:
                  type: string
                  description: Remix 的文本描述
                  maxLength: 1000
                  example: 在结尾添加品牌 Logo
      responses:
        '200':
          description: Remix 任务创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoObject'
              example:
                id: video_def456789abc012345678901234567890123456789
                object: video
                created_at: 1762789902
                status: queued
                model: sora-2
                prompt: 在结尾添加品牌 Logo
                progress: 0
                seconds: '4'
                size: 720x1280
                remixed_from_video_id: video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737
        '404':
          description: 原视频任务不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    VideoObject:
      type: object
      properties:
        id:
          type: string
          description: 视频任务的唯一标识符
          example: video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737
        object:
          type: string
          description: 对象类型
          enum:
            - video
          example: video
        created_at:
          type: integer
          description: 创建时间戳（Unix 时间）
          example: 1762789802
        completed_at:
          type: integer
          description: 任务完成时间戳（仅在 success 状态下存在）
          example: 1762789891
        expires_at:
          type: integer
          description: 视频过期时间戳（仅在 success 状态下存在）
          example: 1762793491
        model:
          type: string
          description: 使用的模型名称
          example: sora-2
        status:
          type: string
          description: 任务状态
          enum:
            - queued
            - processing
            - success
            - failed
          example: queued
        prompt:
          type: string
          description: 生成视频的文本描述
          example: 一个无人机从海滩升空拍摄夕阳
        progress:
          type: integer
          description: 处理进度（0-100）
          minimum: 0
          maximum: 100
          example: 0
        seconds:
          type: string
          description: 视频时长（字符串格式）
          example: '8'
        size:
          type: string
          description: 视频分辨率
          example: 720x1280
        assets:
          type: array
          description: 生成的视频资源数组，仅在 success 状态下存在（部分供应商可能不返回此字段，需通过 /content 端点下载）
          items:
            $ref: '#/components/schemas/VideoAsset'
        remixed_from_video_id:
          type: string
          description: Remix 来源视频 ID（仅 Remix 任务返回）
          example: video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737
        error:
          type: object
          description: 错误信息，仅在 failed 状态下存在
          properties:
            code:
              type: string
              example: generation_failed
            message:
              type: string
              example: 视频生成失败，请重试
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: 错误描述
              example: Invalid request parameters
            type:
              type: string
              description: 错误类型
              example: invalid_request_error
            code:
              type: string
              description: 错误代码
              example: invalid_parameters
    VideoAsset:
      type: object
      properties:
        url:
          type: string
          description: 视频文件 URL
          example: >-
            https://cdn.example.com/video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737.mp4
        quality:
          type: string
          description: 视频质量/分辨率
          example: 1280x720
        duration:
          type: integer
          description: 视频时长（秒）
          example: 8
        size_bytes:
          type: integer
          description: 文件大小（字节）
          example: 5242880
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 使用 API Key 作为 Bearer Token

````