curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "sand-ai/magi-2/text-to-video",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "In a rainy neon-lit alley at night, a street musician plays a slow saxophone melody and says: \"Thanks for staying till the last song.\"",
"duration": 5,
"aspect_ratio": "16:9"
}
}
'{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-29T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}Sand AI
MAGI-2 文生视频
MAGI-2 文生视频 API 根据文本提示词生成 4–30 秒的 1080p 视频,并同步生成对白、音效和环境音。
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "sand-ai/magi-2/text-to-video",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "In a rainy neon-lit alley at night, a street musician plays a slow saxophone melody and says: \"Thanks for staying till the last song.\"",
"duration": 5,
"aspect_ratio": "16:9"
}
}
'{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-29T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
模型
- sand-ai/magi-2/text-to-video — 1080p 文生视频,4–30 秒,支持同步音频。
功能
- 单次生成 4–30 秒 1080p 视频。
- 同步生成对白、音效和环境音,也可关闭音频仅输出视频。
- 支持六种宽高比:
16:9、9:16、1:1、4:3、3:4和21:9。 - 提示词最长支持 15,000 个字符,适合细化剧本与分镜。
- 可选
seed参数便于复现结果。
必填参数
prompt(string):描述场景、主体、动作、运镜与声音,最多 15,000 个字符。角色对白请放在引号内。
可选参数
duration(integer):视频时长(整秒),范围4到30,默认5。resolution(string):固定1080p。aspect_ratio(string):16:9(默认)、9:16、1:1、4:3、3:4或21:9。generate_audio(boolean):true(默认)生成同步音频;false仅输出无声视频。seed(integer):随机种子,0到2147483647。
输出
任务完成后返回单个 MP4 文件:25 fps 的 H.264 视频;当generate_audio 为 true 时附带 AAC 立体声音轨。
示例
- 对白场景:5 秒
16:9夜景街头镜头,引号内指定角色台词。 - 竖屏短片:4 秒
9:16动感镜头,附带环境音效。 - 超宽无声镜头:4 秒
21:9沙漠画面,设置generate_audio: false并固定seed。
注意事项
- 其他模式的字段(
image_urls、reference_*)在本接口会返回 400。model和callback_url放在请求根级,不放在input内。 - 积分按
duration秒数计费(1080p),generate_audio开关不改变价格。任务失败全额退还。当前价格见定价页。
请求体
application/json