Lyria 3.5 生成音乐
- 用 Lyria 3.5 模型生成音乐,异步任务
- 与 Flow Music 主接口同一端点,靠
version字段区分 - 单次只出一首
认证
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。这是与普通 Flow Music 生成的关键区别——那边不传或传其他值。
风格与音色的描述提示词。
sound_prompt 与 lyrics 不能都不传。
歌词文本。可以先调「生成歌词」接口拿到再回填。
与 sound_prompt 至少传一个。
作品标题。
每分钟节拍数,取值须不小于 1。类型是字符串,例如 "96"。
时长,单位秒,范围 1 到 240。
随机种子。同请求同种子结果相似但不保证一致。
每次请求只生成一首。与 Suno 那边一次出两首不同,这里的 audio_index 永远是 1。
Always flowmusic, case-insensitive.
Always lyria-3.5. This is the key difference from regular Flow Music generation, where you omit it or pass another value.
A description prompt for style and timbre.
sound_prompt and lyrics can't both be omitted.
The lyrics text. You can call the "Generate lyrics" endpoint first and feed the result back.
At least one of this and sound_prompt is required.
The title of the work.
Beats per minute, at least 1. The type is a string, e.g. "96".
Duration in seconds, 1 to 240.
A random seed. The same request and seed give similar results, though not guaranteed identical.
Each request generates exactly one track. Unlike Suno, which returns two at a time, audio_index here is always 1.
提交响应
状态码,成功为 200。
提交时为 submitted。
任务标识,用于查询。
The status code; 200 on success.
submitted at submission.
The task identifier, used for queries.
任务查询响应
任务 ID。
如 completed。
进度百分比。
创建时间戳。
完成时间戳。
实际耗时,单位秒。
计费金额。
积分消耗。
音频结果列表。
music[] 元素字段
片段 ID。
标题。
时长,字符串形式的数值。
创建时间,ISO 8601 格式。
歌词内容。
歌词 ID。
歌词时间标记对。
音频链接,m4a 格式。
WAV 链接。
封面图链接。
The task ID.
Such as completed.
Progress percentage.
Creation timestamp.
Completion timestamp.
Actual duration in seconds.
The billed amount.
Credits consumed.
The list of audio results.
Fields of music[] entries
The clip ID.
The title.
Duration as a numeric string.
Creation time in ISO 8601 format.
The lyrics content.
The lyrics ID.
The lyrics timing marker pairs.
The audio URL, in m4a format.
The WAV URL.
The cover image URL.
与普通 Flow Music 的差异
| 项目 | 普通生成 | Lyria 3.5 |
|---|---|---|
| 端点 | /v1/music/generations | 同一个端点 |
version | 不传或传其他值 | 必须传 lyria-3.5 |
| 单次产出 | 1 首 | 1 首 |
两条路共用端点,靠 version 分流。忘了传 version 就会走普通模型,产出结果与预期不同,但不报错——这是最容易忽略的一点。
| Item | Regular | Lyria 3.5 |
|---|---|---|
| Endpoint | /v1/music/generations | The same endpoint |
version | Omitted or another value | Must be lyria-3.5 |
| Output per request | 1 track | 1 track |
Both paths share the endpoint and are routed by version. Forgetting version silently falls through to the regular model, producing different output without any error — the easiest thing to overlook here.
错误
| code | Notes |
|---|---|
invalid_request | Parameter validation failed |
Common code values:
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.