淡入
- 为已有音轨添加开头淡入效果,异步任务
- 用
duration_s控制淡入时长 - 淡入失败通常是时长超过了源音频长度
认证
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引用源音轨
产出源音轨的那次任务的标识。缺失或无法解析出源音轨时,提交阶段立即返回 400。
从源任务结果的 data.result.music[] 中选取要处理的曲目,默认 1,从 1 起始。一次生成通常产出 2 首。
基于已有歌曲操作时,只需 task_id 与 audio_index 两个值,无需另外记录任何 ID。
The identifier of the task that produced the source track. When it's missing or the source track can't be resolved, submission returns a 400 immediately.
Selects the track to process from the source task's data.result.music[], default 1, starting at 1. A single generation usually produces 2.
Working from an existing song needs only task_id and audio_index; no other ID has to be recorded.
请求参数
音频模型,省略时默认为 suno,当前仅此一个取值。
淡入时长,单位秒。须大于 0 且不超过源音轨的已知时长,允许小数秒。
处理后音轨的标题,默认 Untitled。
The audio model; defaults to suno when omitted, currently the only value.
Fade-in length in seconds. Must be greater than 0 and no longer than the source track's known duration; fractional seconds allowed.
The title of the processed track; defaults to Untitled.
关于 duration_s 的上限
上限取决于源音轨有多长,而源音轨的时长在提交前无法得知。所以想稳妥一点,先查一次源任务拿 duration_seconds,再决定淡入时长。
一般的经验值:淡入取源曲长的 3% 到 8%。3 分钟的歌就是 5 到 14 秒。
本端点没有版本参数。传 version 会被忽略,也不影响计费。
The ceiling depends on how long the source track is, and that length isn't known before submission. To be safe, query the source task once for duration_seconds before choosing the fade length.
A rough rule of thumb: use 3% to 8% of the source length. A three-minute song means 5 to 14 seconds.
This endpoint has no version parameter. Passing version is ignored and doesn't affect billing.
响应
响应状态码。
任务状态,提交成功为 submitted。
任务唯一标识,轮询时使用。
The response status code.
The task status; submitted on successful submission.
The unique task identifier, used when polling.
取结果
用 GET /v1/music/tasks/{task_id} 轮询,间隔 3 到 5 秒,典型耗时 30 到 120 秒。
status 的中间态为 pending、processing,终态为 completed 或 failed。progress 是 0 到 100 的整数,不保证按固定节点变化。
完成后从 data.result.music[] 每一项的 audio_url 取音频。失败时 data.error.message 给出原因,预扣额度自动退回。
Poll GET /v1/music/tasks/{task_id} every 3 to 5 seconds; typical duration is 30 to 120 seconds.
Intermediate status values are pending and processing; terminal values are completed or failed. progress is an integer from 0 to 100 that isn't guaranteed to change on fixed steps.
On completion, take the audio from each entry's audio_url in data.result.music[]. On failure, data.error.message gives the reason and the held balance is refunded automatically.
错误码
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.