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

# 阿里 Pix 平台接口参考

> 阿里 Pix 文生图、图生图、文生视频与模板化生成

## 图片结果查询接口

`GET /openapi/v2/image/result/{image_id}`

根据 image\_id 查询图片模版生成任务的状态与结果。

### 请求参数 (Query / Path)

<ParamField path="image_id" type="string" required>
  图片 ID
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求示例 (cURL)

```bash theme={null}
curl "https://socialvision.tisyk.xyz/openapi/v2/image/result/{image_id}" \
  -H "Authorization: Bearer sk-YOUR_API_KEY"
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 获取TTS 音色

`GET /openapi/v2/video/lip_sync/tts_list`

分页获取可用的 TTS 音色列表，供对口型视频生成使用。

### 请求参数 (Query / Path)

<ParamField query="page_num" type="string" required>
  页码（从 1 开始）
</ParamField>

<ParamField query="page_size" type="string" required>
  每页条数
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求示例 (cURL)

```bash theme={null}
curl "https://socialvision.tisyk.xyz/openapi/v2/video/lip_sync/tts_list" \
  -H "Authorization: Bearer sk-YOUR_API_KEY"
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 获取视频状态

`GET /openapi/v2/video/result/{video_id}`

根据 video\_id 查询视频生成任务的状态与结果。

### 请求参数 (Query / Path)

<ParamField path="video_id" type="string" required>
  视频任务 ID
</ParamField>

<ParamField header="API-KEY" type="string" required>
  平台 API Key（请求头）
</ParamField>

### 请求示例 (cURL)

```bash theme={null}
curl "https://socialvision.tisyk.xyz/openapi/v2/video/result/{video_id}" \
  -H "Authorization: Bearer sk-YOUR_API_KEY"
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 图片模版生成接口

`POST /openapi/v2/image/template/generate`

使用已上传图片与模版 ID 生成图片，返回 image\_id 供结果查询。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="img_ids" type="array" required>
  图片资源 ID 列表
</ParamField>

<ParamField body="template_id" type="integer" required>
  模板 ID
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "img_ids": [
    0
  ],
  "template_id": 384631857552768
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/image/template/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "img_ids": [
    0
  ],
  "template_id": 384631857552768
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 上传图片

`POST /openapi/v2/image/upload`

图生视频/首尾帧都需要先上传图片, 通过img\_id 完成生成.
生成时需要传image文件的路径
支持格式 : "png", "webp", "jpeg", "jpg" . 支持 mime-type "image/jpeg","image/jpg","image/png","image/webp"
最大支持 10000px 以内的图片

### 请求参数 (Query / Path)

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="image" type="string">
  重要提示：上传图片时，必须使用携带本地图片文件路径的 form-data 格式，目前不支持通过 URL 上传图片。
</ParamField>

<ParamField body="image_url" type="string">
  支持url 上传. 只传 image or image\_url即可. 只支持一下格式/mime-type: "image/jpeg","image/jpg","image/png","image/webp"
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "image": "",
  "image_url": ""
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/image/upload" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "image": "",
  "image_url": ""
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 上传资源(视频/音频)

`POST /openapi/v2/media/upload`

1.

支持以下mime/type & 后缀
"video/mp4": "mp4",
"video/mov": "mov",
"video/webm": "webm",
"video/quicktime": "mov"
"audio/mpeg": "mp3",
"audio/wav": "wav",
"audio/vnd.wave": "wav",
"audio/x-wav": "wav",
"audio/x-m4a": "m4a",
"audio/aac": "aac",
"audio/x-aac": "aac",
"audio/wave": "wav",
"audio/mp4": "mp3"
2\.
视频文件限制
最大分辨率：1920
最大文件大小：50MB
最大时长：30秒
3\.
音频文件限制
最大文件大小：50MB
最大时长：30秒

### 请求参数 (Query / Path)

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="file" type="string">
  file or file\_url 二选一
</ParamField>

<ParamField body="file_url" type="string">
  可以使用url 上传资源. 支持以下mime-type/ 后缀
  "video/mp4": "mp4", "video/mov": "mov", "video/webm": "webm", "video/quicktime": "mov"
  "audio/mpeg": "mp3", "audio/wav": "wav", "audio/vnd.wave": "wav", "audio/x-wav": "wav", "audio/x-m4a": "m4a", "audio/aac": "aac", "audio/x-aac": "aac", "audio/wave": "wav", "audio/mp4": "mp3"
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "file": "",
  "file_url": ""
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/media/upload" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "file": "",
  "file_url": ""
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 生成延长(Extend)视频

`POST /openapi/v2/video/extend/generate`

基于已有视频延长生成时长，可指定 prompt 与模型参数。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="duration" type="integer" required>
  视频生成时长
  v.3.5/v4/v4.5 : 5/8 (v3.5 1080p 无法使用 8)
  v5 : 5/8
  v5.5 : 5/8/10 (1080p 无法使用 10)
  v6 : 1\~15
</ParamField>

<ParamField body="model" type="string" required>
  模型 "v3.5","v4","v4.5","v5",“v5.5“,"v6"
</ParamField>

<ParamField body="motion_mode" type="string">
  "normal","fast". "fast" 不支持 8s, "v5" 不支持此字段
</ParamField>

<ParamField body="prompt" type="string" required>
  2048 Characters 以内
</ParamField>

<ParamField body="quality" type="string" required>
  "360p","540p","720p","1080p"
</ParamField>

<ParamField body="seed" type="integer">
  随机种子；相同种子便于复现
</ParamField>

<ParamField body="source_video_id" type="integer">
  必传source\_video\_id 或 video\_media\_id
</ParamField>

<ParamField body="style" type="string">
  风格，可选："anime"、"3d\_animation"、"day"、"cyberpunk"、"comic"，如非必要可不传
</ParamField>

<ParamField body="video_media_id" type="integer">
  必传source\_video\_id 或 video\_media\_id
</ParamField>

<ParamField body="water_mark" type="boolean" required>
  是否添加水印
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "duration": 8,
  "model": "v5",
  "motion_mode": "normal",
  "prompt": "across the universe",
  "quality": "540p",
  "seed": 123123,
  "source_video_id": 123123,
  "water_mark": false
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/extend/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "duration": 8,
  "model": "v5",
  "motion_mode": "normal",
  "prompt": "across the universe",
  "quality": "540p",
  "seed": 123123,
  "source_video_id": 123123,
  "water_mark": false
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 多主体(多参考)生成视频

`POST /openapi/v2/video/fusion/generate`

使用多张参考图（主体/背景）与 prompt 生成融合视频，支持 @ref\_name 引用。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="aspect_ratio" type="string" required>
  1.基础提供 "16:9","9.16","4:3","3:4","1:1" 画幅比
  2.v6, c1 额外支持 "2:3","3:2","21:9"
</ParamField>

<ParamField body="duration" type="integer" required>
  视频生成时长
  v4.5 : 5/8 (v3.5 1080p 无法使用 8)
  v5 : 5/8
  v5.5/5.6 : 5/8/10 (1080p 无法使用 10)
</ParamField>

<ParamField body="generate_audio_switch" type="boolean">
  支持v5.6,v6, c1 / 控制开关Audio. true: Audio on , false: Audio off
</ParamField>

<ParamField body="image_references" type="array" required>
  图像引用数组（1–3 项），包含“主体”或“背景”
  v4.5/v5 : 最多3张
  v5.5/v5.6/v6 : 最多7张
</ParamField>

<ParamField body="model" type="string" required>
  "v4.5","v5","v5.5","v5.6",,"v6", "c1"
</ParamField>

<ParamField body="prompt" type="string" required>
  使用 @ref\_name 精确描述场景
  1\.
  @ref\_name 后必须有空格，如 @cat plays
  2\.
  prompt 中引用的名称必须与 image\_references 中的 ref\_name 完全一致
</ParamField>

<ParamField body="quality" type="string" required>
  "360p","540p","720p","1080p"
</ParamField>

<ParamField body="seed" type="integer">
  随机种子；相同种子便于复现
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "aspect_ratio": "16:9",
  "duration": 5,
  "image_references": [
    {
      "img_id": 0,
      "ref_name": "dog",
      "type": "subject"
    },
    {
      "img_id": 0,
      "ref_name": "room",
      "type": "background"
    }
  ],
  "model": "v5.6",
  "prompt": "@dog plays at @room",
  "quality": "720p",
  "seed": 123456789
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/fusion/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "aspect_ratio": "16:9",
  "duration": 5,
  "image_references": [
    {
      "img_id": 0,
      "ref_name": "dog",
      "type": "subject"
    },
    {
      "img_id": 0,
      "ref_name": "room",
      "type": "background"
    }
  ],
  "model": "v5.6",
  "prompt": "@dog plays at @room",
  "quality": "720p",
  "seed": 123456789
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 生成视频模版

`POST /openapi/v2/video/img/generate`

基于已上传图片与模版 ID 生成图生视频，支持单图或多图模版。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="duration" type="integer" required>
  传5即可, 实际duration 按照模版时长生成
</ParamField>

<ParamField body="img_id" type="integer" required>
  单图模版时使用
</ParamField>

<ParamField body="img_ids" type="array">
  多图模版时使用 ex) "img\_ids ":\[0,0]
</ParamField>

<ParamField body="model" type="string" required>
  传任何模型即可, 模版与模型不相关
</ParamField>

<ParamField body="prompt" type="string" required>
  模版不识别prompt, 传空即可
</ParamField>

<ParamField body="quality" type="string" required>
  "360p","540p","720p","1080p"
</ParamField>

<ParamField body="sound_effect_switch" type="boolean">
  true时, 会有背景音乐
</ParamField>

<ParamField body="template_id" type="integer" required>
  模版ID
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "duration": 5,
  "img_id": 1,
  "model": "v6",
  "prompt": "string",
  "quality": "720p",
  "template_id": 0
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/img/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "duration": 5,
  "img_id": 1,
  "model": "v6",
  "prompt": "string",
  "quality": "720p",
  "template_id": 0
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 生成对口型(Lipsync)视频

`POST /openapi/v2/video/lip_sync/generate`

为视频添加对口型效果，可使用 TTS 音色或上传音频驱动口型。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="audio_media_id" type="integer">
  必传audio\_media\_id 或 lip\_sync\_tts\_speaker\_id + lip\_sync\_tts\_conent. 使用用户上传的音频
</ParamField>

<ParamField body="lip_sync_tts_content" type="string">
  必传audio\_media\_id 或 lip\_sync\_tts\_speaker\_id + lip\_sync\_tts\_conent 使用我们的TTS 服务
</ParamField>

<ParamField body="lip_sync_tts_speaker_id" type="string">
  必传audio\_media\_id 或 lip\_sync\_tts\_speaker\_id + lip\_sync\_tts\_conent. 使用我们的TTS 服务. 通过接口获取TTS 音色.
</ParamField>

<ParamField body="source_media_id" type="integer">
  必传 source\_video\_id 或 video\_media\_id. 通过用户上传的视频
</ParamField>

<ParamField body="video_media_id" type="integer">
  必传 source\_video\_id 或 video\_media\_id 通过pixverse 生成的视频
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "lip_sync_tts_content": "hello this is harry, where are you from?",
  "lip_sync_tts_speaker_id": "auto",
  "video_media_id": 0
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/lip_sync/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "lip_sync_tts_content": "hello this is harry, where are you from?",
  "lip_sync_tts_speaker_id": "auto",
  "video_media_id": 0
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 主体替换(Swap) Mask 生成

`POST /openapi/v2/video/mask/selection`

为指定视频帧生成主体替换所需的 Mask，供后续 Swap 视频生成使用。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="keyframe_id" type="integer">
  从1 到最后视频帧. 如果不提供默认为1
</ParamField>

<ParamField body="source_video_id" type="integer">
  通过拍我API 生成的video\_id, 必传source\_video\_id 或 video\_media\_id
  编码需要为 h.264/h.265
</ParamField>

<ParamField body="video_media_id" type="integer">
  通过接口上传的视频 media\_id,必传source\_video\_id 或 video\_media\_id
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "keyframe_id": 1,
  "source_video_id": 0
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/mask/selection" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "keyframe_id": 1,
  "source_video_id": 0
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 动作模仿(Mimic) 视频生成

`POST /openapi/v2/video/mimic/generate`

让参考图片中的人物模仿源视频中的动作，生成 Mimic 效果视频。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="img_id" type="integer" required>
  上传图片后获取的img\_id
</ParamField>

<ParamField body="quality" type="string" required>
  "360p","540p","720p","1080p"
</ParamField>

<ParamField body="source_video_id" type="integer">
  通过拍我API 生成的video\_id, 必传source\_video\_id 或 video\_media\_id
</ParamField>

<ParamField body="video_media_id" type="integer">
  通过接口上传的视频 media\_id,必传source\_video\_id 或 video\_media\_id
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "img_id": 0,
  "quality": "360p",
  "video_media_id": 0
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/mimic/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "img_id": 0,
  "quality": "360p",
  "video_media_id": 0
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 视频编辑(Modify) 生成视频

`POST /openapi/v2/video/modify/generate`

对视频指定帧进行编辑，支持 mask 选区与参考图片替换，通过 prompt 描述编辑意图。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string" required>
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string" required>
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="img_ids" type="array">
  通过上传接口获取的img\_id, 最多支持3个
</ParamField>

<ParamField body="keyframe_ids" type="integer">
  指定使用视频中的哪一帧进行替换(编辑)
</ParamField>

<ParamField body="mask_ids" type="array">
  通过swap-mask接口获取的mask\_id, 最多支持3个
</ParamField>

<ParamField body="prompt" type="string" required>
  如果 Prompt 中使用了 mask，请使用 @selection0、@selection1；如果使用参考图片，请使用 @img0、@img1
  , 支持 5000字符
</ParamField>

<ParamField body="quality" type="string" required>
  "360p","540p","720p"
</ParamField>

<ParamField body="source_video_id" type="string" required>
  通过拍我AI 生成的视频video\_id,必传source\_video\_id 或 video\_media\_id
</ParamField>

<ParamField body="video_media_id" type="integer">
  通过接口上传的视频 media\_id,必传source\_video\_id 或 video\_media\_id
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "img_ids": [
    123
  ],
  "keyframe_ids": 1,
  "mask_ids": [
    "3847593904"
  ],
  "prompt": "@selection0 subject is swapped with @img0",
  "quality": "540p",
  "source_video_id": "1234",
  "video_media_id": 1234
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/modify/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "img_ids": [
    123
  ],
  "keyframe_ids": 1,
  "mask_ids": [
    "3847593904"
  ],
  "prompt": "@selection0 subject is swapped with @img0",
  "quality": "540p",
  "source_video_id": "1234",
  "video_media_id": 1234
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 多帧(Multi-transition) 视频生成

`POST /openapi/v2/video/multi_transition/generate`

使用 2–7 张图片按序生成多段过渡视频，每段可独立设置时长与 prompt。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="model" type="string" required>
  "v3.5","v4","v4.5","v5"
</ParamField>

<ParamField body="multi_transition" type="array" required>
  1. multi\_transition 必须是一个包含 2 到 7 个元素的数组。2
     . multi\_transition 中的每个元素应包含：img\_id（必填，整数）、duration（必填，整数，最后一个元素可选）、prompt（可选，字符串）。
</ParamField>

<ParamField body="quality" type="string" required>
  "360p","540p","720p","1080p"
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "model": "v5",
  "motion_mode": "normal",
  "multi_transition": [
    {
      "duration": 3,
      "img_id": 0,
      "prompt": ""
    },
    {
      "duration": 3,
      "img_id": 0,
      "prompt": ""
    },
    {
      "duration": 3,
      "img_id": 0,
      "prompt": ""
    },
    {
      "duration": 3,
      "img_id": 0,
      "prompt": ""
    },
    {
      "duration": 0,
      "img_id": 0,
      "prompt": ""
    }
  ],
  "quality": "360p"
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/multi_transition/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "v5",
  "motion_mode": "normal",
  "multi_transition": [
    {
      "duration": 3,
      "img_id": 0,
      "prompt": ""
    },
    {
      "duration": 3,
      "img_id": 0,
      "prompt": ""
    },
    {
      "duration": 3,
      "img_id": 0,
      "prompt": ""
    },
    {
      "duration": 3,
      "img_id": 0,
      "prompt": ""
    },
    {
      "duration": 0,
      "img_id": 0,
      "prompt": ""
    }
  ],
  "quality": "360p"
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 重绘视频生成视频

`POST /openapi/v2/video/restyle/generate`

对已有视频应用重绘风格，可通过 restyle\_id 或 restyle\_prompt 指定效果。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="restyle_id" type="integer">
  从重绘效果列表获取的ID, restyle\_id 或restyle\_prompt 需要填写
</ParamField>

<ParamField body="restyle_prompt" type="string">
  支持提示词替换风格, restyle\_id 或restyle\_prompt 需要填写
  5000 字符以内
</ParamField>

<ParamField body="seed" type="integer">
  随机种子；相同种子便于复现
</ParamField>

<ParamField body="source_video_id" type="integer">
  用户用拍我API 生成过的视频, 必传source\_video\_id 或 video\_media\_id
</ParamField>

<ParamField body="video_media_id" type="integer">
  用户上传的视频,必传source\_video\_id 或 video\_media\_id
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "restyle_id": 0,
  "seed": 0,
  "source_video_id": 0
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/restyle/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "restyle_id": 0,
  "seed": 0,
  "source_video_id": 0
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 音效生成(sound\_effect)接口

`POST /openapi/v2/video/sound_effect/generate`

为已有视频生成或叠加音效，可保留原声或指定音效内容。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="original_sound_switch" type="boolean">
  控制是否播放背景音乐。必须为布尔值。
</ParamField>

<ParamField body="sound_effect_content" type="string">
  可选。如果未提供，则会生成随机音效。
</ParamField>

<ParamField body="source_video_id" type="integer">
  必传source\_video\_id 或 video\_media\_id
</ParamField>

<ParamField body="video_media_id" type="integer">
  必传source\_video\_id 或 video\_media\_id
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "original_sound_switch": true,
  "sound_effect_content": "",
  "source_video_id": 343252978602905
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/sound_effect/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "original_sound_switch": true,
  "sound_effect_content": "",
  "source_video_id": 343252978602905
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 主体替换(Swap) 视频生成

`POST /openapi/v2/video/swap/generate`

使用 Mask 与参考图片替换视频中的主体，生成 Swap 效果视频。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="img_id" type="integer" required>
  图片资源 ID
</ParamField>

<ParamField body="keyframe_id" type="integer" required>
  从1 到最后视频帧. 如果不提供默认为1
</ParamField>

<ParamField body="mask_id" type="string" required>
  蒙版 ID
</ParamField>

<ParamField body="quality" type="string" required>
  输出质量档位
</ParamField>

<ParamField body="source_video_id" type="integer">
  通过拍我API 生成的video\_id, 必传source\_video\_id 或 video\_media\_id
</ParamField>

<ParamField body="video_media_id" type="integer">
  通过接口上传的视频 media\_id,必传source\_video\_id 或 video\_media\_id
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "img_id": 0,
  "keyframe_id": 1,
  "mask_id": "0",
  "quality": "360p",
  "source_video_id": 0
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/swap/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "img_id": 0,
  "keyframe_id": 1,
  "mask_id": "0",
  "quality": "360p",
  "source_video_id": 0
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 生成文生视频

`POST /openapi/v2/video/text/generate`

通过 prompt 进行文生视频生成，支持多种模型、画幅比与时长配置。

### 请求参数 (Query / Path)

<ParamField header="API-KEY" type="string">
  API-KEY 来自 拍我API开放平台
</ParamField>

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

### 请求体参数 (Body)

<ParamField body="aspect_ratio" type="string" required>
  1. 基础提供 "16:9","9.16","4:3","3:4","1:1" 画幅比
  2. v6,c1 支持 "16:9","9.16","4:3","3:4","1:1","2:3","3:2","21:9"
</ParamField>

<ParamField body="camera_movement" type="string">
  可以在文/图生视频添加运镜(支持v4,v4.5版本)
  支持参数: "horizontal\_left","horizontal\_right","vertical\_up","vertical\_down",
  "zoom\_in","zoom\_out","crane\_up",
  "quickly\_zoom\_in","quickly\_zoom\_out","smooth\_zoom\_in",
  "camera\_rotation","robo\_arm","super\_dolly\_out","whip\_pan","hitchcock",
  "left\_follow","right\_follow","pan\_left","pan\_right","fix\_bg"
</ParamField>

<ParamField body="duration" type="integer" required>
  视频生成时长
  视频生成时长
  v.3.5/v4/v4.5 : 5/8 (v3.5 1080p 无法使用 8)
  v5 : 5/8
  v5.5/5.6 : 5/8/10 (1080p 无法使用 10)
  v6/c1 : 1\~15 任意时长
</ParamField>

<ParamField body="generate_audio_switch" type="boolean">
  支持 v5.5,v5.6,v6,c1
  / 控制开关Audio. true: Audio on , false: Audio off
</ParamField>

<ParamField body="generate_multi_clip_switch" type="boolean">
  支持:v5.5,v6
  控制单镜头, 多镜头 true: 多镜头 , false: 单镜头/
</ParamField>

<ParamField body="lip_sync_tts_content" type="string">
  \~140Chracters (UTF-8). 可输入想要的tts 内容
</ParamField>

<ParamField body="lip_sync_tts_speaker_id" type="string">
  获取TTS 音色后的id
</ParamField>

<ParamField body="lip_sync_tts_switch" type="boolean">
  true, false
  如果想一起使用对口型 请传为true
</ParamField>

<ParamField body="model" type="string" required>
  模型 "v3.5","v4","v4.5", "v5","v5.5","v5.6","v6","c1"
</ParamField>

<ParamField body="motion_mode" type="string">
  "normal","fast". "fast" 不支持 8s, "v5" 以上版本不支持此字段
</ParamField>

<ParamField body="prompt" type="string" required>
  5000 Characters 以内
</ParamField>

<ParamField body="quality" type="string" required>
  "360p","540p","720p","1080p"
</ParamField>

<ParamField body="seed" type="integer">
  可传随机数 0 - 2147483647
</ParamField>

<ParamField body="sound_effect_content" type="string">
  v5 以下 or 有template\_id时可使用.可输入想要的音效, 如果不填写会根据视频内容生成音效
</ParamField>

<ParamField body="sound_effect_switch" type="boolean">
  v5 以下 or 有template\_id时可使用. true, false
  如果想一起使用sound\_effect 请传为true
</ParamField>

<ParamField body="template_id" type="integer">
  模版(特效)ID , 使用之前需要激活
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "aspect_ratio": "16:9",
  "duration": 5,
  "model": "v6",
  "motion_mode": "normal",
  "prompt": "string",
  "quality": "540p",
  "seed": 0
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/text/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "aspect_ratio": "16:9",
  "duration": 5,
  "model": "v6",
  "motion_mode": "normal",
  "prompt": "string",
  "quality": "540p",
  "seed": 0
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***

## 首尾帧生成视频

`POST /openapi/v2/video/transition/generate`

使用首帧与尾帧图片生成过渡视频，支持运镜与音效等扩展参数。

### 请求参数 (Query / Path)

<ParamField header="Content-Type" type="string">
  请求体 Content-Type，一般为 application/json
</ParamField>

<ParamField header="API-KEY" type="string">
  平台 API Key（请求头）
</ParamField>

### 请求体参数 (Body)

<ParamField body="duration" type="integer" required>
  视频生成时长
  v.3.5/v4/v4.5 : 5/8 (v3.5 1080p 无法使用 8)
  v5 : 5/8
  v5.5/v5.6 : 5/8/10 (1080p 无法使用 10)
  v6/c1 : 1\~15
</ParamField>

<ParamField body="first_frame_img" type="integer" required>
  上传图片后获取的img\_id
</ParamField>

<ParamField body="generate_audio_switch" type="boolean">
  支持 v5.5, v5.6, v6,c1 使用 / 控制开关Audio. true: Audio on , false: Audio off
</ParamField>

<ParamField body="last_frame_img" type="integer" required>
  上传图片后获取的img\_id
</ParamField>

<ParamField body="lip_sync_tts_content" type="string">
  \~140Chracters (UTF-8). 可输入想要的tts 内容
  可适用范围 : "v3.5","v4","v4.5","v5"
</ParamField>

<ParamField body="lip_sync_tts_speaker_id" type="string">
  获取TTS 音色后的id
  可适用范围 : "v3.5","v4","v4.5","v5"
</ParamField>

<ParamField body="lip_sync_tts_switch" type="boolean">
  true, false
  如果想一起使用对口型 请传为true
</ParamField>

<ParamField body="model" type="string" required>
  模型 "v3.5","v4","v4.5", "v5","v5.5","v5.6","v6","c1"
</ParamField>

<ParamField body="motion_mode" type="string">
  "normal","fast". "fast" 不支持 8s, "v5" 不支持此字段
</ParamField>

<ParamField body="prompt" type="string" required>
  2048 Characters 以内
</ParamField>

<ParamField body="quality" type="string" required>
  "360p","540p","720p","1080p"
</ParamField>

<ParamField body="seed" type="integer">
  可传随机数 0 - 2147483647
</ParamField>

<ParamField body="sound_effect_content" type="string">
  可输入想要的音效, 如果不填写会根据视频内容生成音效
</ParamField>

<ParamField body="sound_effect_switch" type="boolean">
  v5 以下 or 有template\_id时可使用.true, false
  如果想一起使用sound\_effect 请传为true
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "duration": 5,
  "first_frame_img": 0,
  "last_frame_img": 0,
  "model": "v4.5",
  "motion_mode": "normal",
  "prompt": "trasnfrom into character",
  "quality": "540p",
  "seed": 937433858
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/openapi/v2/video/transition/generate" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "duration": 5,
  "first_frame_img": 0,
  "last_frame_img": 0,
  "model": "v4.5",
  "motion_mode": "normal",
  "prompt": "trasnfrom into character",
  "quality": "540p",
  "seed": 937433858
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "ErrCode": 0,
  "ErrMsg": "success",
  "RespData": {
    "id": 123456
  }
}
```

***


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