音乐视频渲染
- 把 Flow Music 的音乐渲染成带画面的视频,异步任务
- 用
clip_id引用源音频 - 三种预设模板可选
认证
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请求参数
模型名称,固定传 flowmusic,大小写不敏感。
要渲染成视频的音乐 clip_id,取自已成功任务的 result.music[].clip_id。
视频模板预设,默认 simple。
simple简洁modern现代风格player播放器风格
The model name, always flowmusic, case-insensitive.
The clip_id of the music to render into video, taken from result.music[].clip_id of a successful task.
The video template preset; defaults to simple.
simpleminimalmodernmodern styleplayerplayer style
三种预设怎么选
| 预设 | 视觉特征 | 适合 |
|---|---|---|
simple | 大面积留白,元素最少 | 作为背景音乐视频,不抢注意力 |
modern | 动态几何与渐变 | 社交媒体发布,观感更活跃 |
player | 模拟播放器界面,含进度与封面 | 展示完整曲目信息 |
三种模板的差异主要在视觉呈现,音频内容完全一致。
| Preset | Visual character | Best for |
|---|---|---|
simple | Lots of whitespace, fewest elements | Background music video that doesn't steal attention |
modern | Dynamic geometry and gradients | Social media posts with a livelier feel |
player | Mimics a player UI, with progress and cover art | Showing full track information |
The three templates differ mainly in visual presentation; the audio content is identical.
提交响应
状态码,成功为 200。
任务状态,刚提交时为 submitted。
任务唯一标识,用于后续查询进度与结果。
The status code; 200 on success.
The task status; submitted right after submission.
The unique task identifier, used to query progress and results afterward.
任务查询响应
任务 ID。
任务状态,如 completed。
进度百分比。
创建时间戳。
完成时间戳。
实际耗时,单位秒。
费用。
消耗积分。
生成结果列表。
音频片段 ID。
视频地址。
与 video_url 相同的地址,两个字段指向同一份文件。
结果在 result.music[0].video_url。url 字段是它的别名,两者内容一致,读哪个都行。
The task ID.
The task status, e.g. completed.
Progress percentage.
Creation timestamp.
Completion timestamp.
Actual duration in seconds.
Cost.
Credits consumed.
The generation result list.
The audio clip ID.
The video URL.
The same address as video_url; the two fields point at the same file.
The result is at result.music[0].video_url. The url field is its alias with identical content; either works.
错误
| HTTP | code | 场景 |
|---|---|---|
| 400 | invalid_request | 缺少 clip_id 等参数问题 |
| 429 | rate_limit_error | 当前分组容量饱和,需稍后重试 |
视频文件通常比音频大一个数量级,且地址可能有有效期。拿到后应尽快下载转存,不要直接把 CDN 地址嵌进长期使用的页面。
| HTTP | code | Scenario |
|---|---|---|
| 400 | invalid_request | Parameter problems such as a missing clip_id |
| 429 | rate_limit_error | Current group capacity is saturated; retry later |
Video files are usually an order of magnitude larger than audio, and the URL may have a lifetime. Download and copy them promptly rather than embedding the CDN address in a long-lived page.
For more 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.