Lyria 3.5 Cover 改编
- 用 Lyria 3.5 做 Cover 改编,异步任务
- 与普通 Cover 共用端点,靠
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——模型名只有一个,版本走 version 字段。
固定传 lyria-3.5。这是本接口与普通 Cover 的唯一区别。
源音乐唯一标识,取自已成功任务的 result.music[].clip_id。
Cover 编辑指令,例如「将这首歌曲改为爵士风格」。
编辑强度,取值 0 到 1。越大改动越大。
Cover 后的音乐标题。
随机种子,用于结果复现。
Always flowmusic, case-insensitive.
Don't write lyria-3.5 or flowmusic-lyria-3.5 — there's only one model name; the version goes in the version field.
Always lyria-3.5. This is the only difference from regular cover.
The source music's unique identifier, taken from result.music[].clip_id of a successful task.
The cover edit instruction, e.g. "turn this song into a jazz style".
Edit strength, 0 to 1. Higher means bigger changes.
The title of the remixed music.
A random seed for reproducing results.
最容易踩的一个坑
model 与 version 是两个字段,职责不同:
| 字段 | 传什么 | 传错的后果 |
|---|---|---|
model | flowmusic | 写成 lyria-3.5 会找不到模型 |
version | lyria-3.5 | 不传就走普通模型,不报错但结果不同 |
第二行是隐性的:漏传 version 不会报错,只是走的不是 Lyria。产出结果对不对,只有对比才知道。
model and version are two fields with different jobs:
| Field | What to pass | Cost of getting it wrong |
|---|---|---|
model | flowmusic | Writing lyria-3.5 makes the model not found |
version | lyria-3.5 | Omitting it runs the regular model — no error, but different output |
The second row is silent: forgetting version raises nothing, it just isn't Lyria. Whether the output is right only shows up in comparison.
提交响应
状态码,成功为 200。
任务状态,提交时为 submitted。
任务唯一标识,用于查询状态与结果。
The status code; 200 on success.
The task status; submitted at submission.
The unique task identifier, used to query status and results.
查询结果
用 GET /v1/music/tasks/{task_id} 查询。
任务 ID。
如 completed。
进度百分比。
创建时间,Unix 时间戳。
完成时间,Unix 时间戳。
耗时,单位秒。
费用。
积分消耗。
Cover 产物对应的新 clip_id。后续操作请使用新值。
标题。
时长,字符串形式。
音频地址,m4a。
WAV 格式地址。
封面图地址。
Query with GET /v1/music/tasks/{task_id}.
The task ID.
Such as completed.
Progress percentage.
Creation time, Unix timestamp.
Completion time, Unix timestamp.
Duration in seconds.
Cost.
Credits consumed.
The new clip_id of the cover output. Use the new value for later operations.
The title.
Duration as a string.
The audio URL, m4a.
The WAV-format URL.
The cover image URL.
错误
| HTTP | code | 说明 |
|---|---|---|
| 400 | invalid_request | strength 越界,如 strength must be between 0 and 1 |
| 429 | rate_limit_error | 当前分组容量饱和,请稍后重试 |
| HTTP | code | Notes |
|---|---|---|
| 400 | invalid_request | strength out of range, e.g. strength must be between 0 and 1 |
| 429 | rate_limit_error | Current group capacity is saturated; retry later |
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.