跳轉到主要內容

概覽

影片生成是異步的。您提交請求並收到一個任務 ID,然後輪詢結果。

Request Body

model
string
預設值:"sora-2"
影片模型 ID。請參閱 Video Generation Guide 以獲取涵蓋 11 個供應商、超過 80 個模型的完整列表。
prompt
string
必填
要生成的影片文字描述。
image_url
string
用於圖生影片 (I2V) 生成的起始圖片 URL。
image
string
帶有數據 URL 前綴的 Base64 編碼圖片(例如 data:image/jpeg;base64,...)。圖生影片 (I2V) 生成中 image_url 的替代方案。
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
終端用戶的唯一識別碼。

Response

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": "sora-2",
    "prompt": "A cat walking through a garden, cinematic lighting",
    "duration": 5
  }'
{
  "task_id": "video_abc123",
  "status": "pending",
  "model": "sora-2",
  "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"
    }
)

關鍵幀控制

使用 start_imageend_image 來控制第一幀和最後一幀(由 Seedance 2.0 支援):
response = requests.post(
    "https://api.lemondata.cc/v1/videos/generations",
    headers={"Authorization": "Bearer sk-your-api-key"},
    json={
        "model": "seedance-2-0",
        "prompt": "Smooth transition from day to night",
        "start_image": "https://example.com/day.jpg",
        "end_image": "https://example.com/night.jpg",
        "duration": 5
    }
)

可用模型

模型列表會頻繁更新。如需獲取最新可用模型和定價,請訪問 Models page
如需包含功能比較和使用範例的完整指南,請參閱 Video Generation Guide

Sora (OpenAI)

模型功能
sora-2T2V (預設)
sora-2-proT2V, 更高品質
sora-2-charactersT2V, 專注於角色

可靈 (快手)

模型功能
kling-v2.6-proT2V, 最新一代
kling-v2.6-stdT2V, 快速
kling-v2.1-masterT2V, I2V, 大師級品質
kling-v2.1-proT2V, I2V
kling-videoT2V, I2V
kling-video-extend影片延伸
kling-video-o1-proT2V, O1 推理
kling-effects視覺效果

Veo (Google)

模型功能
veo3.1T2V
veo3.1-proT2V, 專業級
veo3.1-4kT2V, 4K 輸出
veo3.1-fastT2V, 快速
veo3T2V, 前一代

豆包 (字節跳動)

模型功能
seedance-2-0T2V, I2V, 關鍵幀, 延伸, 編輯
seedance-1-5-proT2V, I2V
seedance-1-0-proT2V, I2V
seedance-1-0-lite-t2vT2V, 輕量級
seedance-1-0-lite-i2vI2V, 輕量級

其他供應商

模型供應商功能
hailuo-2.3MiniMaxT2V, I2V
hailuo-2.3-proMiniMaxT2V, I2V, 更高品質
wan-2.6阿里巴巴T2V
wan2.6-i2v阿里巴巴I2V
runwayml-gen4-turbo-5RunwayT2V, I2V (5s)
runwayml-gen4-turbo-10RunwayT2V, I2V (10s)
luma-video-apiLumaT2V
luma-video-extend-apiLuma影片延伸
viduq3-pro生數科技T2V, I2V
viduq2-pro生數科技T2V, I2V
grok-video-3xAIT2V
higgsfield-turboHiggsfieldT2V