生成音乐视频
- 把音频合成为带可视画面的视频文件,异步任务
- 结果在
data.result.videoUrl - 与「音乐视频渲染」(Flow Music)是两个不同接口
认证
All endpoints authenticate with a Bearer token.
Get an API key: open the console and create one.
Add it to the request header:
Authorization: Bearer YOUR_OAIRoute_KEY请求参数
音频模型,默认 suno,当前传 suno。
产出源音轨那次任务的 task_id。缺失或无法解析源时返回 400。
引用源任务结果 data.result.music[] 中的第几首,默认 1,从 1 开始。一次生成通常 2 首。
本端点没有版本参数,不要传 version。
The audio model; defaults to suno, and you pass suno today.
The task_id of the task that produced the source track. Returns a 400 when it's missing or the source can't be resolved.
Which track in the source task's data.result.music[], default 1, starting at 1. A single generation usually has 2.
This endpoint has no version parameter; don't pass version.
响应
响应状态码。
任务状态,提交成功后为 submitted。
任务唯一标识,用于轮询获取结果。
The response status code.
The task status; submitted on successful submission.
The unique task identifier, used to poll for the result.
取结果
轮询 GET /v1/music/tasks/{task_id}。
视频地址,完成后优先读取这个字段。
兼容历史返回格式。
兼容历史返回格式。
返回结构有三套写法。新任务读 data.result.videoUrl;老任务的数据在 result.videos[] 或 result.music[].video_url 里。接的时候按这三处依次兜底。
Poll GET /v1/music/tasks/{task_id}.
The video URL; read this field first once complete.
Compatibility with a legacy response shape.
Compatibility with a legacy response shape.
There are three response shapes. New tasks read data.result.videoUrl; old tasks keep their data in result.videos[] or result.music[].video_url. Handle all three in order as fallbacks when integrating.
视频里有什么
生成的是「配了可视画面」的音乐视频,画面通常随音乐节奏变化,形态接近可视化音频或动态封面,不是叙事性的 MV。
需要叙事性内容,应该用视频生成接口自己出片,再用剪辑工具配上音频。
What's generated is a music video "with visuals": the imagery usually shifts with the beat, closer to an audio visualization or animated cover than a narrative MV.
If you need narrative content, generate the clip with a video generation endpoint yourself, then pair it with the audio in an editing tool.
计费与产出
按次计费,与音频生成分开结算。产出的视频文件通常比音频大一个数量级,注意存储成本。
视频地址可能有有效期,拿到后尽快转存。不要把它当作长期存储地址直接嵌在前端页面里。
Billed per call, settled separately from audio generation. The resulting video file is usually an order of magnitude larger than the audio; watch your storage costs.
Video URLs may have a lifetime. Copy them promptly after receiving them, and don't embed them in a front-end page as long-term storage.
错误码
For error response formats, status codes, and retry guidance see Error codes and rate limits; for troubleshooting steps on common errors see the FAQ.
使用示例
提交一个任务并拿到 task_id:
提交成功只表示任务已受理。真正的产物要拿返回的 task_id 去任务查询接口轮询,status 变成 completed 之后才有结果。
Submit a task and get a task_id:
A successful submission only means the task was accepted. To get the actual output, poll the task query endpoint with the returned task_id; results appear only after status becomes completed.