Lyria 3.5 片段替换
- 用 Lyria 3.5 替换音乐中的某一段,异步任务
- 与普通片段替换共用端点,靠
version区分 - 产出新的 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,大小写不敏感。
文档特别提示:不要写成 lyria-3.5 或 flowmusic-lyria-3.5 当作 model。模型名只有一个,版本走 version 字段。
版本固定为 lyria-3.5。
作为替换源的音频 clip_id,取自已完成任务的 result.music[].clip_id。
替换区间起点,单位秒。
替换区间终点,单位秒。须大于 start_s,不能超过源 clip 时长。
指定如何改写该片段的编辑指令,例如「替换为钢琴版本」。
替换后音乐标题。
随机种子,用于复现或控制生成结果。
The model name, always flowmusic, case-insensitive.
The docs say explicitly: don't put lyria-3.5 or flowmusic-lyria-3.5 in model. There's only one model name; the version goes in the version field.
The version, fixed at lyria-3.5.
The clip_id of the audio to use as the replacement source, taken from result.music[].clip_id of a completed task.
The start of the replacement range, in seconds.
The end of the replacement range, in seconds. Must be greater than start_s and can't exceed the source clip's duration.
An edit instruction specifying how to rewrite the segment, e.g. "replace with a piano version".
The title of the replaced music.
A random seed for reproducing or steering the output.
提交响应
状态码,成功为 200。
任务状态,提交时初始值为 submitted。
任务唯一标识,用于后续查询任务状态与结果。
The status code; 200 on success.
The task status; initially submitted at submission.
The unique task identifier, used to query task status and results afterward.
取结果
接口为异步:提交后返回 task_id,需另行查询 GET /v1/music/tasks/{task_id}。
替换结果会产出新的 clip_id(整首歌重新输出)。后续操作应使用这个新 clip_id,不是原来的。
完成后从 data.result.music[] 读取:
| 字段 | 说明 |
|---|---|
clip_id | 新的片段标识 |
title | 标题 |
duration_seconds | 时长 |
audio_url | 音频地址 |
wav_url | WAV 地址 |
image_url | 封面图 |
The endpoint is asynchronous: submission returns a task_id, and you query GET /v1/music/tasks/{task_id} separately.
The replacement produces a new clip_id (the whole song is re-rendered). Later operations should use this new clip_id, not the original.
On completion, read from data.result.music[]:
| Field | Description |
|---|---|
clip_id | The new clip identifier |
title | The title |
duration_seconds | Duration |
audio_url | The audio URL |
wav_url | The WAV URL |
image_url | The cover image |
错误
| HTTP | code | Notes |
|---|---|---|
| 400 | invalid_request | Invalid parameters, e.g. an invalid range |
| 429 | rate_limit_error | Current group capacity is saturated |
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.