> ## 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/秒 输出 + 同价输入参考视频） 

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

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

## 推荐用法：只传 `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 预览成片 |

```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));
```

```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"
  }
}
```

## 认证

**Authorization** `string` *required*

Bearer Token 认证。访问 [API Key 管理页面](https://apimart.ai/keys) 获取密钥。

```
Authorization: Bearer YOUR_API_KEY
```

## 请求参数

**model** `string` *required*

固定值：`MiniMax-H3-Regeneration`

**nsfw\_check** `boolean` (default: false)

是否在提交视频任务前执行内容审核。

* `true`：使用 `omni-moderation-latest` 审核提示词和输入图片
* `false` 或不传：不发起审核请求，不增加审核成本与延迟（默认）

**source\_task\_id** `string` *required*

本平台上一条 **成功的 MiniMax-H3 · 768P** 任务 ID。

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

## 源视频规格

源视频须符合 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

**code** `integer`

响应状态码，成功时为 200

**data** `array`

提交时返回 `status` / `task_id`；查询完成后结果在 `result.videos`（与普通视频任务相同）

**数组元素**

**status** `string`

初始为 `submitted`

**task\_id** `string`

任务 ID，用于 [查询状态](https://docs.apimart.ai/cn/api-reference/tasks/status.md)

> [!NOTE]
>
> 使用 [获取任务状态](https://docs.apimart.ai/cn/api-reference/tasks/status.md) 轮询。成功后取 `result.videos[0].url`。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.