AIAPIAIAPI API

Wan 2.2 I2V Spicy

Model ID alibaba/wan-2.2-i2v-spicy

概览

图生视频模型:需要提供首帧图片,并支持可选的首尾帧插值。

Alibaba · image-to-video

接口

POST /v1/video/generations

认证

Authorization: Bearer <AIAPIAIAPI_API_KEY>

请求体

参数类型必填可空默认值约束说明
modelstring-values: alibaba/wan-2.2-i2v-spicy用于路由请求的模型 ID。
promptstring--描述目标生成结果的文本提示词。
imagestring-accepts: HTTPS URL, Base64 data URL, Bare Base64必填的首帧图片,支持 HTTP/HTTPS URL 或 Base64 图片数据。
end_imagestring-accepts: HTTPS URL, Base64 data URL, Bare Base64可选的尾帧图片;提供后,模型将在 image 与 end_image 之间生成过渡视频。
durationinteger`5`values: 5, 8视频时长(秒),仅支持 5 或 8。
resolutionstring`480p`values: 480p, 720p输出视频分辨率。
seedinteger-min: 0随机种子;省略或设为 0 时随机生成,使用正整数时可复现结果。
prompt_extendboolean`true`-是否让上游模型扩展或增强提示词。

model

类型:string · 必填:是 · 可空:否

用于路由请求的模型 ID。

prompt

类型:string · 必填:是 · 可空:否

描述目标生成结果的文本提示词。

image

类型:string · 必填:是 · 可空:否

必填的首帧图片,支持 HTTP/HTTPS URL 或 Base64 图片数据。

end_image

类型:string · 必填:否 · 可空:否

可选的尾帧图片;提供后,模型将在 image 与 end_image 之间生成过渡视频。

duration

类型:integer · 必填:否 · 可空:否

视频时长(秒),仅支持 5 或 8。

resolution

类型:string · 必填:否 · 可空:否

输出视频分辨率。

seed

类型:integer · 必填:否 · 可空:否

随机种子;省略或设为 0 时随机生成,使用正整数时可复现结果。

prompt_extend

类型:boolean · 必填:否 · 可空:否

是否让上游模型扩展或增强提示词。

请求示例

curl --request POST \
  --url https://aiapiaiapi.com/v1/video/generations \
  --header 'Authorization: Bearer $AIAPIAIAPI_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
      "model": "alibaba/wan-2.2-i2v-spicy",
      "prompt": "A cinematic camera movement through a forest",
      "image": "https://example.com/reference.jpg",
      "duration": 5,
      "resolution": "480p"
    }'

JSON

{
  "model": "alibaba/wan-2.2-i2v-spicy",
  "prompt": "A cinematic camera movement through a forest",
  "image": "https://example.com/reference.jpg",
  "duration": 5,
  "resolution": "480p"
}

响应

{
  "id": "vid_01K2ABC123",
  "object": "video.generation",
  "model": "alibaba/wan-2.2-i2v-spicy",
  "status": "queued",
  "progress": null,
  "outputs": [],
  "created_at": 1786960800,
  "started_at": null,
  "completed_at": null,
  "error": null
}

任务状态

使用创建响应中的 id 作为 task_id

GET /v1/video/generations/{task_id}

{
  "id": "vid_01K2ABC123",
  "object": "video.generation",
  "model": "alibaba/wan-2.2-i2v-spicy",
  "status": "completed",
  "progress": 100,
  "outputs": [
    { "type": "video", "url": "https://cdn.example.com/videos/vid_01K2ABC123.mp4" }
  ],
  "created_at": 1786960800,
  "started_at": 1786960805,
  "completed_at": 1786960900,
  "error": null
}

错误响应

参数校验错误返回 HTTP 400,并包含稳定的错误代码。

{
  "error": {
    "type": "invalid_request_error",
    "code": "unsupported_value",
    "message": "The parameter value is not supported by this model.",
    "param": "duration"
  }
}

文档索引

获取完整文档索引:

https://aiapiaiapi.com/llms.txt

使用该文件发现所有可用的 API 文档。