Muse Video 视频生成
通过文本提示词或最多 9 张参考图生成 720p 有声 MP4 视频, 时长 2-10 秒
国内用户请注意: 中国大陆用户请使用 https://toapis.cn 作为接口地址(Base URL)。文档示例中的 https://toapis.com 请替换为 https://toapis.cn。
- 模型名称:
muse-video - 文生视频与参考图生视频由
image_urls是否传入自动区分,没有模式参数 - 输出为
720p有声 MP4,时长2-10秒,按秒计费 - 异步任务接口,提交后返回统一的
generation.task
不支持首尾帧控制、参考视频/音频、quality、seed 以及高于 720p 的分辨率。audio 无法关闭,生成视频始终带声音。
认证
Authorizationstring请求头必填所有接口均需要使用 Bearer Token 认证。
Authorization: Bearer YOUR_API_KEY请求参数
modelstring请求体必填默认值: muse-video视频生成模型名称,固定为 muse-video。
promptstring请求体必填视频内容描述。建议明确描述主体、动作、场景、镜头、风格和声音要求。支持中英文提示词。
durationinteger请求体默认值: 10视频时长(秒),支持 2-10 的整数值。
resolutionstring请求体默认值: 720p输出分辨率。仅支持 720p,传入其他值会被上游拒绝。
aspect_ratiostring请求体默认值: 16:9输出视频宽高比。
可选值:1:1、16:9、9:16、4:3、3:4、3:2、2:3。
参考图请求中省略该参数时,输出比例跟随参考图。
image_urlsstring[]请求体参考图 URL 数组,最多 9 张。支持 URL、Data URI 和 base64 输入;所有图片合计不得超过 11 MiB。
- 不传或传空数组为文生视频
- 传入一张或多张图片为参考图生视频
ninteger请求体默认值: 1生成视频数量。仅支持 1。
client_business_idstring请求体你的业务标识,例如订单号或交易 ID。可通过同一状态查询接口用该值查询任务。
callback_urlstring请求体ToAPIs 任务完成回调地址。需先配置 Token URL 和签名密钥,详见 任务 Webhook。
metadataobject请求体转发给上游模型的可选参数。
字段说明
nsfw_checkboolean请求体生成前对请求执行内容审核。
languagestring请求体上游 webhook 错误消息的语言。
输入模式
| 模式 | 请求方式 | aspect_ratio |
|---|---|---|
| 文生视频 | 仅 prompt | 指定比例,默认 16:9 |
| 参考图生视频 | prompt + image_urls(1-9 张) | 指定比例,或省略跟随参考图 |
请求示例
文生视频
{
"model": "muse-video",
"prompt": "一位旅客走进霓虹灯下的车站,镜头向前推进,只有环境音",
"duration": 10,
"resolution": "720p",
"aspect_ratio": "16:9"
}参考图生视频
{
"model": "muse-video",
"prompt": "图中的瓶身在棚拍灯光下缓慢旋转,保持瓶形和标签一致",
"duration": 6,
"aspect_ratio": "9:16",
"image_urls": [
"https://example.com/bottle-front.png",
"https://example.com/bottle-side.png"
]
}响应
idstringToAPIs 任务 ID,用于查询任务状态。
objectstring对象类型,固定为 generation.task。
modelstring本次请求使用的模型,固定为 muse-video。
statusstring任务状态:queued、in_progress、completed 或 failed。
progressinteger任务进度百分比,取值 0-100。
created_atinteger任务创建时间,Unix 秒级时间戳。
提交后轮询 查询视频任务状态。任务完成后,视频地址位于 result.data[0].url。
请求示例
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "muse-video",
"prompt": "海浪在日落时分轻轻拍打沙滩,镜头缓慢平移,自然海声",
"duration": 10,
"resolution": "720p",
"aspect_ratio": "16:9"
}'curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "muse-video",
"prompt": "图中的产品在棚拍灯光下缓慢旋转",
"duration": 6,
"aspect_ratio": "9:16",
"image_urls": [
"https://example.com/front.png",
"https://example.com/side.png"
]
}'import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json",
},
json={
"model": "muse-video",
"prompt": "图中的产品在棚拍灯光下缓慢旋转",
"duration": 6,
"aspect_ratio": "9:16",
"image_urls": [
"https://example.com/front.png",
"https://example.com/side.png",
],
},
)
print(response.json())const response = await fetch("https://toapis.com/v1/videos/generations", {
method: "POST",
headers: {
Authorization: "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "muse-video",
prompt: "图中的产品在棚拍灯光下缓慢旋转",
duration: 6,
aspect_ratio: "9:16",
image_urls: [
"https://example.com/front.png",
"https://example.com/side.png"
]
})
});
console.log(await response.json());响应示例
{
"id": "vid_01M840FXWTM23BKN1JR68C5XEM",
"object": "generation.task",
"model": "muse-video",
"status": "queued",
"progress": 0,
"created_at": 1795431069
}