# 爆款视频提示词复刻

- API 版本：1.10.0
- 最后更新：2026-09-29
- 服务地址：`https://api.ailingtu.com`
- 网页文档：[爆款视频提示词复刻](/openapi/viral-replication)
- 完整接口约束：[JSON Schema](/openapi/operations/streamViralVideoReplication.json)
- 接口发现：[接口索引](/openapi/operations/index.json)

## POST /v1/material/analysisTask/stream

接口标识：`streamViralVideoReplication`

根据公开视频链接或已上传文件，流式返回可用于二创的爆款视频提示词。将 streaming 事件中的 result 按到达顺序拼接；若收到 done 事件，以其 result 作为完整提示词。

鉴权：请求头 `x-api-key: <YOUR_API_KEY>`；密钥仅保存在服务端。

成功判断：按 SSE 事件判断成功，拼接 streaming 片段；收到 done 时使用完整 result。错误时检查 HTTP 状态和 message，不按 JSON code=0 判断。

### 请求参数

| 字段 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| `type` | body | REPLICATION | 是 | 固定传 REPLICATION；ANALYSIS 为预留能力，本接口文档不覆盖 |
| `url` | body | string(uri) | 条件必填 | 公开视频链接；与 businessId 二选一。支持 TikTok、抖音、小红书、视频号、Instagram、YouTube、Bilibili |
| `businessId` | body | string | 条件必填 | 已上传文件或素材 ID；与 url 二选一。本地文件请先走预签名上传，再传入 fileId 字符串 |
| `businessType` | body | FILE \| MATERIAL | 条件必填 | 与 businessId 一起使用；本地上传文件传 FILE，素材库已有素材传 MATERIAL |

请求格式：`application/json`

### 请求示例：通过公开视频链接复刻

```json
{
  "type": "REPLICATION",
  "url": "https://www.tiktok.com/@creator/video/7123456789012345678"
}
```

### 请求示例：通过已上传文件复刻

```json
{
  "type": "REPLICATION",
  "businessId": "591",
  "businessType": "FILE"
}
```

### 流式事件：增量提示词片段

```json
{
  "status": "streaming",
  "result": "**Video Script Title**\nA clean product reveal with a slow camera push-in.\n",
  "thinking": null,
  "id": 2066122904659169300
}
```

### 流式事件：完整提示词

```json
{
  "status": "done",
  "result": "**Video Script Title**\nA clean product reveal with a slow camera push-in.\n\n**Characters / Main Subjects**\nA seller presenting a summer product against a bright studio backdrop.\n\n**Scene / Environment**\nBright studio lighting, close-up product shots, and a final call to action.\n\n**Script**\n00:00-00:02 Hook the viewer with the product in hand.\n00:02-00:08 Show the key selling points in short cuts.\n00:08-00:10 End with a clear purchase CTA.\n\n**Notes**\nKeep the pacing tight and preserve the original hook-to-CTA structure.",
  "thinking": null,
  "id": 2066122904659169300
}
```

### 响应字段

以下列出主要层级；完整结构、联合类型及校验规则以接口 JSON Schema 为准。必填指字段所在对象中的约束。

| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| `status` | string | 是 | streaming 表示增量片段；服务端发送终态事件时，done 表示完整提示词。；可选值：streaming、done |
| `result` | string | 是 | streaming 事件中为增量提示词，done 事件中为完整提示词。 |
| `thinking` | string \| null | 否 | — |
| `id` | integer | 否 | 分析任务 ID，同一请求的所有片段保持一致。 |

### 接入说明与限制

- 成功时响应 Content-Type 为 text/event-stream，不要按 JSON 的 code === 0 判断成功。
- 每条 SSE 行为 data:<json>；json 含 status、result、thinking 和任务 id。同一请求的 id 保持不变。
- 按到达顺序拼接 status=streaming 的 result。若出现 status=done，以其 result 作为完整提示词。
- 请求失败时直接返回 JSON 错误体，不会进入 SSE。请读取 HTTP 状态码和 message。
- 本地 MP4 请先调用 /v1/file/presign 与 /v1/file/confirm，再传 businessId 和 businessType=FILE。
- 完整提示词通常是 Markdown 结构，包含标题、主体、场景、分镜脚本和制作笔记，可继续用于 AI 视频生成。

### 错误处理

| HTTP | 说明 |
|---|---|
| 400 | 请求参数或请求体无效，请修正后重试。 |
| 401 | API 密钥缺失或无效，请检查 x-api-key。 |
| 403 | API 密钥没有此接口的调用权限。 |
| 429 | 请求过于频繁，请采用指数退避重试。 |
| 500 | 服务端发生错误；对于暂时性故障采用指数退避重试。 |

业务 code 非零时也应按失败处理。不要对参数、权限或授权错误盲目重试。创建发布或生成任务超时后先查询原任务，避免重复创建。

### 相关接口

- [获取预签名上传地址](/openapi/presign) · [Markdown](/openapi/operations/createFileUpload.md)
- [确认文件上传完成](/openapi/confirm) · [Markdown](/openapi/operations/confirmFileUpload.md)
- [创建 AI 图片或视频生成任务](/openapi/schedule-create) · [Markdown](/openapi/operations/createAiGenerationSchedule.md)
