提交生成视频任务-异步
方法: POST路径: /luma/generations_sync
提交任务速度更快,适合有上传图片这种响应慢的情况,避免客户端超时 但是,失败系统无法自动重试,失败率会更高
请求参数
Header 参数
text
Authorization
string
可选
示例:
Bearer {{YOUR_API_KEY}}Body 参数 application/json
text
user_prompt
string
必需
aspect_ratio
string
可选
expand_prompt
boolean
可选
是否开启prompt 优化
image_url
string
可选
参考图,支持第三方图片地址、Base64
image_end_url
string
可选
关键帧,支持第三方图片地址、Base64
notify_hook
string
可选
回调地址:
https://xxxxxxx
示例
{
"user_prompt"
:
"string"
,
"aspect_ratio"
:
"string"
,
"expand_prompt"
:
true
,
"image_url"
:
"string"
,
"image_end_url"
:
"string"
,
"notify_hook"
:
"string"
}请求示例代码
Shell
bash
curl --location --request POST '/luma/generations_sync' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"user_prompt": "string",
"aspect_ratio": "string",
"expand_prompt": true,
"image_url": "string",
"image_end_url": "string",
"notify_hook": "string"
}'返回响应
🟢 200 成功
内容类型: application/json
响应结构
text
object示例
json
{
"id": "9d4b7516-77e5-481a-b015-48313946f33b",
"prompt": "cat dance",
"state": "pending",
"created_at": "2024-07-01T07:35:13.498660Z",
"video": null,
"liked": null,
"estimate_wait_seconds": null
}