# Vidu StartEnd2Video 首尾帧生视频

> 视频生成

提交异步任务。请求体中的模型和参数按本模型文档填写，响应会返回任务 ID。

## 请求地址

`POST https://api.modelverse.cn/v1/tasks/submit`

## 请求体

## 响应

- **200** — 任务提交成功。
- **400** — 请求参数无效。
- **default** — 错误响应。

## OpenAPI 定义

```json
{
  "openapi": "3.1.0",
  "x-language": "zh-CN",
  "info": {
    "title": "Vidu-StartEnd2Video接口文档",
    "version": "1.0.0",
    "description": "这是 ModelVerse 上 `Vidu-StartEnd2Video` 的视频接口文档，说明如何提交生成任务、查询任务状态、读取视频结果以及处理错误。\n接口路径包括 `POST /v1/tasks/submit`、`GET /v1/tasks/status`。\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "该模型文档中使用的 ModelVerse API 端点。"
    }
  ],
  "tags": [
    {
      "name": "Vidu StartEnd2Video",
      "description": "Vidu start/end frame-to-video asynchronous task operations."
    }
  ],
  "paths": {
    "/v1/tasks/submit": {
      "post": {
        "tags": [
          "Vidu StartEnd2Video"
        ],
        "operationId": "submitViduStartEnd2VideoTask",
        "summary": "Vidu StartEnd2Video 首尾帧生视频",
        "description": "提交异步任务。请求体中的模型和参数按本模型文档填写，响应会返回任务 ID。\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ViduStartEnd2VideoSubmitRequest"
              },
              "examples": {
                "documented": {
                  "summary": "源文档 首尾帧生视频 请求",
                  "value": {
                    "model": "viduq2-pro",
                    "input": {
                      "first_frame_url": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
                      "last_frame_url": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
                      "prompt": "Continue the video with smooth camera movement."
                    },
                    "parameters": {
                      "vidu_type": "start-end2video",
                      "duration": 5,
                      "resolution": "1080p",
                      "movement_amplitude": "auto",
                      "bgm": true
                    }
                  }
                },
                "base64Frames": {
                  "summary": "提交with Base64 编码 first and 尾帧s",
                  "value": {
                    "model": "viduq2-turbo",
                    "input": {
                      "first_frame_url": "data:image/png;base64,{base64_encode}",
                      "last_frame_url": "data:image/png;base64,{base64_encode}",
                      "prompt": "A smooth transition from the first frame to the final frame with gentle camera motion."
                    },
                    "parameters": {
                      "vidu_type": "start-end2video",
                      "duration": 8,
                      "seed": 12345,
                      "resolution": "720p",
                      "movement_amplitude": "medium",
                      "bgm": false
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务提交成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduStartEnd2VideoSubmitResponse"
                },
                "examples": {
                  "submitted": {
                    "summary": "已提交任务",
                    "value": {
                      "output": {
                        "task_id": "task_id"
                      },
                      "request_id": "request_id"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求参数无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduStartEnd2VideoErrorResponse"
                },
                "examples": {
                  "paramError": {
                    "$ref": "#/components/examples/ViduStartEnd2VideoParamError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduStartEnd2VideoErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/ViduStartEnd2VideoParamError"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/status": {
      "get": {
        "tags": [
          "Vidu StartEnd2Video"
        ],
        "operationId": "getViduStartEnd2VideoTaskStatus",
        "summary": "Vidu StartEnd2Video 任务状态",
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "Asynchronous task identifier returned by `/v1/tasks/submit`.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "placeholder": {
                "summary": "源文档占位值",
                "value": "task_id"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "任务状态响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduStartEnd2VideoStatusResponse"
                },
                "examples": {
                  "success": {
                    "summary": "成功任务",
                    "value": {
                      "output": {
                        "task_id": "task_id",
                        "task_status": "Success",
                        "urls": [
                          "https://xxxxx/xxxx.mp4"
                        ],
                        "submit_time": 1756959000,
                        "finish_time": 1756959050
                      },
                      "usage": {
                        "duration": 5
                      },
                      "request_id": ""
                    }
                  },
                  "failure": {
                    "summary": "失败任务",
                    "value": {
                      "output": {
                        "task_id": "task_id",
                        "task_status": "Failure",
                        "submit_time": 1756959000,
                        "finish_time": 1756959019,
                        "error_message": "error_message"
                      },
                      "usage": {
                        "duration": 5
                      },
                      "request_id": ""
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "任务标识或请求参数无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduStartEnd2VideoErrorResponse"
                },
                "examples": {
                  "paramError": {
                    "$ref": "#/components/examples/ViduStartEnd2VideoParamError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduStartEnd2VideoErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/ViduStartEnd2VideoParamError"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n"
      }
    },
    "schemas": {
      "ViduStartEnd2VideoSubmitRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "input",
          "parameters"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "Vidu start/end frame-to-video model name. This schema is pinned to\nthe `Vidu-StartEnd2Video` source document and only allows its\ndocumented model values.\n",
            "enum": [
              "viduq2-pro",
              "viduq2-turbo",
              "viduq2-pro-fast",
              "viduq3-pro"
            ]
          },
          "input": {
            "$ref": "#/components/schemas/ViduStartEnd2VideoInput"
          },
          "parameters": {
            "$ref": "#/components/schemas/ViduStartEnd2VideoParameters"
          }
        }
      },
      "ViduStartEnd2VideoInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "first_frame_url",
          "last_frame_url"
        ],
        "properties": {
          "first_frame_url": {
            "type": "string",
            "description": "First-frame image as a URL or Base64-encoded image. Supported image\nformats are png, jpeg, jpg, and webp. The image must not exceed\n50 MB, must satisfy the documented 1:4 / 4:1 aspect-ratio limit,\nand should have a resolution close to `last_frame_url`.\n",
            "examples": [
              "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
              "data:image/png;base64,{base64_encode}"
            ]
          },
          "last_frame_url": {
            "type": "string",
            "description": "Last-frame image as a URL or Base64-encoded image. Supported image\nformats are png, jpeg, jpg, and webp. The first-frame resolution to\nlast-frame resolution ratio must be between 0.8 and 1.25, and the\nimage must not exceed 50 MB.\n",
            "examples": [
              "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
              "data:image/png;base64,{base64_encode}"
            ]
          },
          "prompt": {
            "type": "string",
            "maxLength": 2000,
            "description": "Text prompt used to guide video generation.",
            "examples": [
              "Continue the video with smooth camera movement."
            ]
          }
        }
      },
      "ViduStartEnd2VideoParameters": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vidu_type"
        ],
        "properties": {
          "vidu_type": {
            "type": "string",
            "const": "start-end2video",
            "description": "Vidu interface type for start/end frame-to-video generation."
          },
          "duration": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8,
            "default": 5,
            "x-model-constraints": {
              "viduq2-pro": {
                "default": 5,
                "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8
                ]
              },
              "viduq2-turbo": {
                "default": 5,
                "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8
                ]
              },
              "viduq2-pro-fast": {
                "default": 5,
                "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8
                ]
              }
            },
            "x-source-undocumented-for-models": [
              "viduq3-pro"
            ],
            "description": "Video duration in seconds. `viduq2-pro`, `viduq2-turbo`, and\n`viduq2-pro-fast` default to 5 and support 1-8 seconds. The source\ndocument lists `viduq3-pro` as an allowed model but does not provide\na separate duration range for it.\n"
          },
          "seed": {
            "type": "integer",
            "default": 0,
            "description": "Random seed. The default value 0 uses a random seed."
          },
          "resolution": {
            "type": "string",
            "default": "720p",
            "x-model-constraints": {
              "viduq2-pro": {
                "default": "720p",
                "enum": [
                  "540p",
                  "720p",
                  "1080p"
                ]
              },
              "viduq2-turbo": {
                "default": "720p",
                "enum": [
                  "540p",
                  "720p",
                  "1080p"
                ]
              },
              "viduq2-pro-fast": {
                "default": "720p",
                "enum": [
                  "720p",
                  "1080p"
                ]
              }
            },
            "x-source-undocumented-for-models": [
              "viduq3-pro"
            ],
            "description": "Output resolution. `viduq2-pro` and `viduq2-turbo` support 540p,\n720p, and 1080p for 1-8 second videos. `viduq2-pro-fast` supports\n720p and 1080p for 1-8 second videos. The source document lists\n`viduq3-pro` as an allowed model but does not provide a separate\nresolution range for it.\n",
            "enum": [
              "540p",
              "720p",
              "1080p"
            ]
          },
          "movement_amplitude": {
            "type": "string",
            "default": "auto",
            "description": "Motion amplitude.",
            "enum": [
              "auto",
              "small",
              "medium",
              "large"
            ]
          },
          "bgm": {
            "type": "boolean",
            "default": false,
            "description": "Whether to add background music."
          }
        }
      },
      "ViduStartEnd2VideoSubmitResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "task_id"
            ],
            "properties": {
              "task_id": {
                "type": "string",
                "description": "异步任务唯一标识。"
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "唯一请求标识。"
          }
        }
      },
      "ViduStartEnd2VideoStatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/ViduStartEnd2VideoStatusOutput"
          },
          "usage": {
            "$ref": "#/components/schemas/ViduStartEnd2VideoUsage"
          },
          "request_id": {
            "type": "string",
            "description": "唯一请求标识。"
          }
        }
      },
      "ViduStartEnd2VideoStatusOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id",
          "task_status"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "异步任务唯一标识。"
          },
          "task_status": {
            "$ref": "#/components/schemas/ViduStartEnd2VideoTaskStatus"
          },
          "urls": {
            "type": "array",
            "description": "视频结果 URL 列表。",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "submit_time": {
            "type": "integer",
            "format": "int64",
            "description": "任务提交时间戳。"
          },
          "finish_time": {
            "type": "integer",
            "format": "int64",
            "description": "任务完成时间戳。"
          },
          "error_message": {
            "type": "string",
            "description": "任务失败时返回的错误信息。"
          }
        }
      },
      "ViduStartEnd2VideoTaskStatus": {
        "type": "string",
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n",
        "enum": [
          "Pending",
          "Running",
          "Success",
          "Failure"
        ]
      },
      "ViduStartEnd2VideoUsage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "duration": {
            "type": "integer",
            "description": "视频时长，单位为秒。"
          }
        }
      },
      "ViduStartEnd2VideoErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ViduStartEnd2VideoErrorObject"
          },
          "request_id": {
            "type": "string",
            "description": "唯一请求标识，如可用。"
          }
        }
      },
      "ViduStartEnd2VideoErrorObject": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "message",
          "type"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "错误信息。"
          },
          "type": {
            "type": "string",
            "description": "错误类型。",
            "examples": [
              "invalid_request_error"
            ]
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "错误码。",
            "examples": [
              "param_error"
            ]
          },
          "param": {
            "type": [
              "string",
              "null"
            ],
            "description": "相关请求参数，如有。"
          }
        }
      }
    },
    "examples": {
      "ViduStartEnd2VideoParamError": {
        "summary": "参数错误",
        "value": {
          "error": {
            "message": "Invalid param",
            "type": "invalid_request_error",
            "code": "param_error",
            "param": "input.first_frame_url"
          },
          "request_id": "request_id"
        }
      }
    }
  }
}
```
