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

# MiniMax-H3 Regeneration 再生成

>  - 将 MiniMax-H3 产出的 768P 视频再生成升为 2K
- 推荐只传 source_task_id，平台自动回填 prompt、素材与源视频
- 不是通用超分：源视频必须是本模型 768P 成片
- 按秒计费（$0.045/秒 输出 + 同价输入参考视频） 

<Info>
  **Full 2K Workflow**（可选）：① [Context-IR](/cn/api-reference/videos/minimax-h3/context-ir) 增强 prompt → ② [MiniMax-H3](/cn/api-reference/videos/minimax-h3/generation) `resolution: "768P"` 预览 → ③ 本接口升 2K。\
  `768P 单价 + 再生成单价 = 直出 2K 单价`，试错更便宜。
</Info>

<Warning>
  **不是通用超分。** 源视频必须是 **MiniMax-H3 生成的 768P** 成片。外部视频（手机拍摄、其他模型生成等）会被拒绝。
</Warning>

## 推荐用法：只传 `source_task_id`

只需传入上一条**成功的 MiniMax-H3 · 768P** 任务 `task_id`，服务端会自动回填所需数据。

```json theme={null}
{
  "model": "MiniMax-H3-Regeneration",
  "source_task_id": "task_01J9HA7J*************"
}
```

`source_task_id` 须同时满足，否则**同步 400**（不建任务、不扣费）：

| 条件               | 说明              |
| ---------------- | --------------- |
| 归属当前账号           | 只能升级自己的任务       |
| 模型为 `MiniMax-H3` | 非其它模型任务         |
| 状态为成功            | 任务已 `completed` |
| 分辨率为 `768P`      | 必须是 768P 预览成片   |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "MiniMax-H3-Regeneration",
      "source_task_id": "task_01J9HA7J*************"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.apimart.ai/v1/videos/generations"

  payload = {
      "model": "MiniMax-H3-Regeneration",
      "source_task_id": "task_01J9HA7J*************",
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json",
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://api.apimart.ai/v1/videos/generations";

  const payload = {
    model: "MiniMax-H3-Regeneration",
    source_task_id: "task_01J9HA7J*************",
  };

  const headers = {
    Authorization: "Bearer <token>",
    "Content-Type": "application/json",
  };

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload),
  })
    .then((response) => response.json())
    .then((data) => console.log(data))
    .catch((error) => console.error("Error:", error));
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": [
      {
        "status": "submitted",
        "task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "请求参数无效",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "身份验证失败，请检查您的API密钥",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "账户余额不足，请充值后再试",
      "type": "payment_required"
    }
  }
  ```
</ResponseExample>

## 认证

<ParamField header="Authorization" type="string" required>
  Bearer Token 认证。访问 [API Key 管理页面](https://apimart.ai/keys) 获取密钥。

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## 请求参数

<ParamField body="model" type="string" required>
  固定值：`MiniMax-H3-Regeneration`
</ParamField>

<ParamField body="source_task_id" type="string" required>
  本平台上一条 **成功的 MiniMax-H3 · 768P** 任务 ID。

  传入后**无需**再传 `prompt`、源视频与参考素材；服务端自动回填。
</ParamField>

## 源视频规格

源视频须符合 MiniMax-H3 的 768P 输出规格：

| 项目    | 要求                              |
| ----- | ------------------------------- |
| 音轨    | **必须有**，不支持无音轨视频                |
| 帧率    | 24 fps                          |
| 宽 / 高 | 均能被 32 整除                       |
| 面积    | ≤ 768 × 1344（1,032,192 像素）      |
| 总帧数   | 107~~362 帧，每档递增 17 帧（约 4~~15 秒） |

规格不符会在任务失败时返回原因并退款。

## 计费

按秒计费（结构与 H3 生成同构，单价不同）：

| 项目            | 单价                          |
| ------------- | --------------------------- |
| 输出（768P → 2K） | **\$0.045 / 秒**             |
| 输入参考视频        | **\$0.045 / 秒**             |
| 输入图片          | 5 张以内免费，超出 **\$0.0225 / 张** |
| 输入音频          | 免费                          |

```
总费用 = 0.045 × (源视频时长 + 参考视频总时长) + 0.0225 × max(0, 图片张数 - 5)
```

> 原 768P 任务用过的素材在再生成时会**重新计费**，不只收输出秒数。

**算例**

| 场景                      | 费用              |
| ----------------------- | --------------- |
| 5 秒源视频，无额外素材            | \$0.225         |
| 10 秒源视频 + 2 张图          | \$0.45（图 ≤5 免费） |
| 6 秒源视频 + 8 秒参考视频 + 7 张图 | \$0.675         |

使用 `source_task_id` 时按原任务真实输出秒数**精确预扣**。

## 请求示例

### source\_task\_id

```json theme={null}
{
  "model": "MiniMax-H3-Regeneration",
  "source_task_id": "task_01J9HA7J*************"
}
```

## 常见错误

提交阶段参数错误为同步 **400**，不建任务、不扣费：

| 场景                  | 说明                                 |
| ------------------- | ---------------------------------- |
| `source_task_id` 无效 | 非本账号 / 非 MiniMax-H3 / 未成功 / 非 768P |

任务失败会自动退款。

## Response

<ResponseField name="code" type="integer">
  响应状态码，成功时为 200
</ResponseField>

<ResponseField name="data" type="array">
  提交时返回 `status` / `task_id`；查询完成后结果在 `result.videos`（与普通视频任务相同）

  <Expandable title="数组元素">
    <ResponseField name="status" type="string">
      初始为 `submitted`
    </ResponseField>

    <ResponseField name="task_id" type="string">
      任务 ID，用于 [查询状态](/cn/api-reference/tasks/status)
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  使用 [获取任务状态](/cn/api-reference/tasks/status) 轮询。成功后取 `result.videos[0].url`。
</Note>
