跳转到主要内容

概览

视频生成是异步的。您提交请求并接收一个任务 ID,然后通过轮询获取结果。

请求体

model
string
默认值:"kling-video"
视频模型(例如 kling-videoveo3.1wan2.6-i2v)。
prompt
string
必填
要生成的视频的文本描述。
image_url
string
用于图生视频(image-to-video)的可选起始图像。
duration
integer
视频时长,以秒为单位(取决于模型)。
aspect_ratio
string
宽高比(例如 16:99:161:1)。
resolution
string
视频分辨率(例如 1080p720p)。
fps
integer
每秒帧数 (1-120)。
negative_prompt
string
视频生成中需要避免的内容。
seed
integer
用于可复现生成的随机种子。
cfg_scale
number
无分类器指导比例 (0-20)。
motion_strength
number
运动强度 (0-1)。
start_image
string
起始帧图像的 URL。
end_image
string
结束帧图像的 URL。
user
string
终端用户的唯一标识符。

响应

task_id
string
用于轮询的唯一任务标识符。
status
string
初始状态:pending
model
string
使用的模型。
curl -X POST "https://api.lemondata.cc/v1/videos/generations" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-video",
    "prompt": "A cat walking through a garden, cinematic lighting",
    "duration": 5
  }'
{
  "task_id": "video_abc123",
  "status": "pending",
  "model": "kling-video",
  "created_at": 1706000000
}

图生视频

response = requests.post(
    "https://api.lemondata.cc/v1/videos/generations",
    headers={"Authorization": "Bearer sk-your-api-key"},
    json={
        "model": "wan2.6-i2v",
        "prompt": "The person starts walking forward",
        "image_url": "https://example.com/image.jpg"
    }
)

可用模型

模型类型描述
kling-videoT2V/I2V逼真的动态效果,多个版本 (v1.0-v2.6)
veo3.1T2VGoogle 最新模型
veo3.1-proT2V专业级质量
minimax/video-01T2V高节奏感与稳定性
wan2.6-i2vI2V图生视频