AIAPIAIAPI API

Kling v3.0 pro Image to Video

Model ID kwaivgi/kling-v3.0-pro/image-to-video

概览

Kuaishou · image-to-video

重要: Optional extra controls: cfg_scale (0–1), multi_shot, shot_type (customize/intelligence), multi_prompt and elements. Multi-shot requires shot_type; customize requires 1–6 prompts with durations at least 1 second summing to the requested duration. At most 6 elements, using an existing element_id or an inline element_name and reference media.

接口

POST /v1/video/generations

认证

Authorization: Bearer <AIAPIAIAPI_API_KEY>

请求体

参数类型必填可空默认值约束说明
modelstring是否-values: kwaivgi/kling-v3.0-pro/image-to-video用于路由请求的模型 ID。
promptstring否否--Optional prompt, up to 2500 characters.
negative_promptstring否否--生成时需要避免的内容。
imagestring是否-accepts: HTTPS URL, Base64 data URLJPG/JPEG/PNG image, at most 10 MB, dimensions at least 300x300 pixels and aspect ratio 0.4–2.5.
end_imagestring否否-accepts: HTTPS URL, Base64 data URL可选的结束帧图片,支持 HTTPS URL 或 Base64 data URL。
audio_enableboolean否否`true`-是否同时生成视频音频。
durationinteger否否`5`range: 3-15生成视频的时长,单位为秒。
resolutionstring否否`1080P`values: 1080P, 1440P-SR输出视频分辨率。

model

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

用于路由请求的模型 ID。

prompt

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

Optional prompt, up to 2500 characters.

negative_prompt

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

生成时需要避免的内容。

image

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

JPG/JPEG/PNG image, at most 10 MB, dimensions at least 300x300 pixels and aspect ratio 0.4–2.5.

end_image

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

可选的结束帧图片,支持 HTTPS URL 或 Base64 data URL。

audio_enable

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

是否同时生成视频音频。

duration

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

生成视频的时长,单位为秒。

resolution

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

输出视频分辨率。

请求示例

curl --request POST \
  --url https://aiapiaiapi.com/v1/video/generations \
  --header 'Authorization: Bearer $AIAPIAIAPI_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
      "model": "kwaivgi/kling-v3.0-pro/image-to-video",
      "prompt": "A cinematic camera movement through a forest",
      "image": "https://example.com/reference.jpg",
      "duration": 5,
      "resolution": "1080P"
    }'

JSON

{
  "model": "kwaivgi/kling-v3.0-pro/image-to-video",
  "prompt": "A cinematic camera movement through a forest",
  "image": "https://example.com/reference.jpg",
  "duration": 5,
  "resolution": "1080P"
}

响应

{
  "id": "vid_01K2ABC123",
  "object": "video.generation",
  "model": "kwaivgi/kling-v3.0-pro/image-to-video",
  "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": "kwaivgi/kling-v3.0-pro/image-to-video",
  "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 文档。