生成混搭
- 把两首已有歌曲融合成一首新歌,异步任务
task_ids必须恰好两个- 其余生成参数与「风格翻唱」同源
认证
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。长度必须恰好为 2,数量不对时提交阶段直接返回 400。
指定每个任务从结果 data.result.music[] 中取第几首,默认 [1, 1],与 task_ids 一一对应。
true 为纯器乐(无人声),false 为带人声。默认 false。
The task_ids of the tasks holding the two source tracks. The length must be exactly 2; any other count returns a 400 at submission.
Which track each task takes from data.result.music[], default [1, 1], corresponding one-to-one with task_ids.
true for instrumental only (no vocals), false for vocals. Defaults to false.
生成参数
音频模型,默认 suno。
公共版本,取值 v6(默认)、v6-wild、v6-mini。使用 custom_model_id 时应省略本字段。
创建模型任务时返回的完整 UUID。与 version、persona_id 互斥。
true 为自定义模式(prompt 作歌词);false 为灵感模式(用 gpt_description)。
不传时按内容推断:有 prompt 则 true;无 prompt 有 gpt_description 则 false;否则有 tags 或 title 则 true。
custom 为 true 且 instrumental 为 false 时必须给出歌词。
灵感模式下不生效,但已提交的内容仍须满足长度限制。
灵感模式提示词。custom 为 false 时必填,缺失会在提交阶段返回 400 且不扣费。
标题,仅 custom 为 true 时生效。
风格标签,仅 custom 为 true 时生效。
需排除的风格标签,仅 custom 为 true 时生效。
true 表示对输入歌词再做一次创作,仅 custom 为 true 时生效。
风格权重,0.00 到 1.00。越界在提交阶段返回 400。仅 custom 为 true 时生效。
创意权重,0.00 到 1.00。兼容旧名 weirdness_constraint,新请求建议用 weirdness。
音频权重,0.00 到 1.00。仅 custom 为 true 时生效。
人声性别,取值 Male 或 Female。两种模式都生效。
风格 ID,仅 custom 为 true 时生效,与 custom_model_id 互斥。
风格变化程度,取值 off、normal、high、extra、max。可省略。
启用 Max 模式,默认 false。要求处于自定义模式,按普通售价 2 倍计费。
输出音频格式,取值 mp3、m4a、wav。
本接口不支持指定目标时长。
The audio model; defaults to suno.
The public version: v6 (default), v6-wild, or v6-mini. Omit this field when using custom_model_id.
The full UUID returned by a model creation task. Mutually exclusive with version and persona_id.
true is custom mode (prompt as lyrics); false is inspiration mode (using gpt_description).
When omitted it's inferred: prompt present means true; no prompt but gpt_description means false; otherwise tags or title means true.
Lyrics must be provided when custom is true and instrumental is false.
Takes no effect in inspiration mode, but anything submitted must still meet the length limits.
The inspiration-mode prompt. Required when custom is false; missing returns a 400 at submission with no charge.
The title; effective only when custom is true.
Style tags; effective only when custom is true.
Style tags to exclude; effective only when custom is true.
true reworks the supplied lyrics once more; effective only when custom is true.
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 name weirdness_constraint is supported; new requests should use weirdness.
Audio weight, 0.00 to 1.00. Effective only when custom is true.
Vocal gender: Male or Female. Effective in both modes.
The style ID; effective only when custom is true, and mutually exclusive with custom_model_id.
Degree of style variation: off, normal, high, extra, max. May be omitted.
Enables Max mode; defaults to false. Requires custom mode; billed at 2× the regular price.
Output audio format: mp3, m4a, or wav.
This endpoint doesn't support specifying a target duration.
响应
响应状态码,成功为 200。
任务状态,取值 submitted。
任务唯一标识,用于轮询 GET /v1/music/tasks/{task_id}。
轮询间隔 3 到 5 秒,音乐生成通常 30 到 120 秒。中间态 pending 或 processing,progress 为 0 到 100 整数且不保证按固定节点变化。完成后从 data.result.music[] 取 audio_url。失败时 data.error.message 说明原因,预扣额度自动退回。
The response status code; 200 on success.
The task status: submitted.
The unique task identifier, used to poll GET /v1/music/tasks/{task_id}.
Poll every 3 to 5 seconds; music generation usually takes 30 to 120 seconds. Intermediate states are pending or processing, progress is an integer from 0 to 100 that isn't guaranteed to change on fixed steps. On completion, take audio_url from data.result.music[]. On failure, data.error.message explains why and the held balance is refunded automatically.
参数校验的顺序
custom 只决定哪些字段生效,但未生效的字段若已提交,仍需满足类型、范围与长度要求。
也就是说:传了 tags 却用灵感模式,tags 不参与生成,但如果它超长,照样会 400。不用的字段就别传。
custom only decides which fields take effect, but fields that don't take effect still have to meet type, range, and length requirements if submitted.
In other words: pass tags while using inspiration mode and tags doesn't participate in generation, but if it's overlong it still returns a 400. Just don't send fields you aren't using.
错误码
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.