音乐延伸
- 对已有音频续写,异步任务
- 用
clip_id引用源音频,指定起点与时长 - 产出的是新的 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,大小写不敏感。
源音频标识,取自成功任务的 result.music[].clip_id。
源任务必须已完成。外部音频需先调「上传音频」接口换取 clip_id。
从第几秒开始续写。不能超过源 clip 的实际时长,超出返回 400。
续写时长,单位秒。上限 164 秒,超出返回 400。
续写编辑指令。例如「延续主歌旋律,加入弦乐」。
续写后作品的标题。
随机种子,用于复现结果。
Always flowmusic, case-insensitive.
The source audio identifier, taken from result.music[].clip_id of a successful task.
The source task must be completed. External audio must first be exchanged for a clip_id via the "Upload audio" endpoint.
The second to start extending from. Can't exceed the source clip's actual duration; exceeding it returns a 400.
Extension duration in seconds. Maximum 164 seconds; exceeding it returns a 400.
The extension edit instruction, e.g. "continue the verse melody and add strings".
The title of the extended work.
A random seed for reproducing results.
结果字段
新的音频标识。后续再做延伸或分轨时要用这个新值,不是原来的 clip_id。
标题,未指定时形如 Untitled (Extended)。
时长,字符串形式的浮点秒数,例如 "39.95733333"。
音频地址,.m4a。
WAV 格式地址。
封面图地址。
时间轴标记,元素为 [时间, 值] 二元数组。
The new audio identifier. Use this new value for further extension or stem separation, not the original clip_id.
The title; when unspecified, something like Untitled (Extended).
Duration as a floating-point number in string form, e.g. "39.95733333".
The audio URL, .m4a.
The WAV-format URL.
The cover image URL.
Timeline markers, each a two-element array [time, value].
两个数值上限
| 字段 | 上限 | 超限结果 |
|---|---|---|
extend_from_s | 源 clip 的实际时长 | 400 |
extend_s | 164 秒 | 400 |
extend_from_s 的上限不是固定值,取决于源音频多长。所以要先查一次源任务,拿到 duration_seconds 再决定起点。
duration_seconds 是字符串。做比较前要先转成浮点数,否则 "39.9" > 40 这种字符串比较会给出错误结果。
| Field | Limit | Result when exceeded |
|---|---|---|
extend_from_s | The source clip's actual duration | 400 |
extend_s | 164 seconds | 400 |
The extend_from_s limit isn't fixed; it depends on how long the source audio is. So query the source task first to get duration_seconds before deciding the start point.
duration_seconds is a string. Convert it to a float before comparing, or string comparison like "39.9" > 40 gives the wrong answer.
错误码
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.