续写延长
- 在已有歌曲的指定时间点之后续写,异步任务
- 用
continue_at精确控制接续位置 - 与「生成音乐」共享大部分参数
认证
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引用源音轨
产出源音轨那次任务的 task_id。缺失或无法定位源音轨时,提交阶段即返回 400。
指定源任务结果 data.result.music[] 中的第几首,默认 1。一次生成一般产出两首。
从源音轨的第几秒开始接续。取值不小于 1,且小于源音轨实际时长,可用小数。
引用源音轨只需 task_id 与 audio_index,不需要额外记录任何 id。上界取决于源音频多长,所以先查一次源任务的 duration 再决定 continue_at。
The task_id of the task that produced the source track. When it's missing or the source track can't be located, submission returns a 400.
Which track in the source task's data.result.music[], default 1. A single generation usually produces two.
The second of the source track to continue from. No less than 1 and less than the source track's actual duration; fractions allowed.
Referencing the source track needs only task_id and audio_index; no extra ids to keep. The upper bound depends on the source audio's length, so query the source task's duration first before choosing continue_at.
请求参数
音频模型,默认 suno,当前只有这一个取值。
公共模型版本,取值 v6(默认)、v6-wild、v6-mini。使用 custom_model_id 时不要传本字段。
创建模型任务返回的完整 UUID。与 version、persona_id 三者互斥,只能取其一。
默认 true。为 true 时按 prompt 歌词续写;只有显式传 false 才改用 gpt_description 引导方向。
续写用的歌词,custom 为 true 时生效。
灵感描述,仅在显式传入 custom: false 时生效。
标题,仅 custom 为 true 时生效。
风格标签,仅 custom 为 true 时生效。注意本端点叫 tags,「生成音乐」那边叫 style。
需要排除的风格标签,仅 custom 为 true 时生效。
人声性别,取值 Male 或 Female。两种模式都生效。
风格权重,取值 0.00 到 1.00。超出范围在提交阶段返回 400。仅 custom 为 true 时生效。
创意度权重,取值 0.00 到 1.00。兼容旧字段名 weirdness_constraint,新请求建议用 weirdness。
音频权重,取值 0.00 到 1.00。仅 custom 为 true 时生效。
为 true 时对输入歌词做二次创作。仅 custom 为 true 时生效。
Persona 风格 ID。仅 custom 为 true 时生效,且与 custom_model_id 互斥。
目标生成时长,取值 10 到 360 秒。仅 custom 为 true 时可用,实际时长以结果为准。
风格变化程度,取值 off、normal、high、extra、max。可省略。
启用 Max 模式,默认 false。要求 custom: true,按普通售价的 2 倍计费。
输出音频格式,取值 mp3、m4a、wav。
The audio model; defaults to suno, currently the only value.
The public model version: v6 (default), v6-wild, or v6-mini. Don't pass this field when using custom_model_id.
The full UUID returned by a model creation task. Mutually exclusive with version and persona_id; pick one of the three.
Defaults to true. With true, continues using prompt as lyrics; only an explicit false switches to gpt_description to steer direction.
Lyrics for the continuation; effective when custom is true.
The inspiration description, effective only when custom: false is passed explicitly.
The title; effective only when custom is true.
Style tags; effective only when custom is true. Note this endpoint calls it tags, while "Generate music" calls it style.
Style tags to exclude; effective only when custom is true.
Vocal gender: Male or Female. Effective in both modes.
Style weight, 0.00 to 1.00. Out of range returns a 400 at submission. Effective only when custom is true.
Creativity weight, 0.00 to 1.00. The old field name weirdness_constraint is supported, but new requests should use weirdness.
Audio weight, 0.00 to 1.00. Effective only when custom is true.
When true, reworks the supplied lyrics. Effective only when custom is true.
The Persona style ID. Effective only when custom is true, and mutually exclusive with custom_model_id.
Target generation duration, 10 to 360 seconds. Available only when custom is true; the actual duration follows the result.
Degree of style variation: off, normal, high, extra, max. May be omitted.
Enables Max mode; defaults to false. Requires custom: true; billed at 2× the regular price.
Output audio format: mp3, m4a, or wav.
响应
响应状态码,成功为 200。
提交成功为 submitted。
任务唯一标识,用于轮询。
轮询时 status 取值 pending、processing、completed、failed,progress 是 0 到 100 的整数但不保证按固定节点推进。完成后从 data.result.music[] 取 audio_url。失败时 data.error.message 给出原因,并自动退回预扣额度。
The response status code; 200 on success.
submitted on successful submission.
The unique task identifier, for polling.
During polling status is pending, processing, completed, or failed, and progress is an integer from 0 to 100 that isn't guaranteed to advance on fixed steps. On completion, take audio_url from data.result.music[]. On failure, data.error.message gives the reason and the held balance is refunded automatically.
与生成音乐的区别
| 项目 | 生成音乐 | 续写延长 |
|---|---|---|
| 风格字段 | style | tags |
| 时长字段 | duration | duration_s |
| 创意度字段 | weirdness_constraint | weirdness(兼容旧名) |
custom 默认值 | false | true |
| 必需引用 | 无 | task_id 加 continue_at |
字段名不一致是这套接口最容易出错的地方。照抄生成音乐的请求体过来,style 和 duration 都不会生效。
| Item | Generate music | Extend track |
|---|---|---|
| Style field | style | tags |
| Duration field | duration | duration_s |
| Creativity field | weirdness_constraint | weirdness (old name supported) |
custom default | false | true |
| Required reference | None | task_id plus continue_at |
The inconsistent field names are the easiest place to go wrong with this API surface. Copy a Generate music request body over and neither style nor duration will take effect.
错误码
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.