删除片段
- 删掉歌曲中指定的一段区间,异步任务
- 删除后前后会自动接上
- 与「裁剪」的区别:裁剪保留区间,删除去掉区间
认证
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 开始计数。
一次生成通常返回 2 首,也就是索引 1 和 2。
The task_id of the task the source track belongs to. Missing, or the source track can't be resolved at submission, returns a 400.
Which track in the task result's data.result.music[], default 1, counting from 1.
A single generation usually returns 2, that is indexes 1 and 2.
删除区间
删除起点的秒数,必须大于等于 0,支持小数。
删除终点的秒数。必须大于 start_s,且不能超过已知的源音轨时长。支持小数。
音频模型,当前只支持 suno。
该端点没有版本维度。即使传入 version,也会被丢弃,且不影响计费。
Removal start in seconds; must be at least 0; fractions allowed.
Removal end in seconds. Must be greater than start_s and no longer than the known source track duration. Fractions allowed.
The audio model; currently only suno.
This endpoint has no version dimension. Even if version is passed, it's discarded and doesn't affect billing.
响应
响应状态码。
任务状态。提交成功时为 submitted;轮询时可能为 pending、processing、completed、failed。
任务唯一标识,用于轮询 GET /v1/music/tasks/{task_id}。
The response status code.
The task status. submitted on successful submission; during polling it may be pending, processing, completed, or failed.
The unique task identifier, used to poll GET /v1/music/tasks/{task_id}.
取结果
轮询间隔 3 到 5 秒,典型耗时 30 到 120 秒。progress 是 0 到 100 的整数,不一定按固定节点变化。终态为 completed 或 failed。
完成后从 data.result.music[] 取处理后的 audio_url。失败时 data.error.message 给出原因,预扣额度自动退回。
Poll every 3 to 5 seconds; typical duration is 30 to 120 seconds. progress is an integer from 0 to 100 and doesn't necessarily change on fixed steps. Terminal states are completed or failed.
On completion, take the processed audio_url from data.result.music[]. On failure, data.error.message gives the reason and the held balance is refunded automatically.
用途
| 场景 | 做法 |
|---|---|
| 去掉一段不好听的间奏 | 标出间奏的起止秒数 |
| 删除口误或杂音 | 标出问题片段 |
| 缩短整体时长 | 删掉重复段落 |
删除后前后直接拼接,接缝可能不自然。如果接缝处能听出突兀,可以改用「段落替换」,用新内容填补这段区间而不是直接删掉。
| Scenario | Approach |
|---|---|
| Drop a bridge you don't like | Mark the bridge's start and end seconds |
| Cut a slip of the tongue or noise | Mark the problematic segment |
| Shorten the overall length | Remove a repeated section |
After removal the two sides are joined directly, and the seam may sound unnatural. If the seam is audible, switch to "Replace section" to fill that range with new content instead of removing it.
错误码
| HTTP | Notes |
|---|---|
| 400 | Invalid request parameters |
| 401 | Authentication failed; check your API key |
| 402 | Insufficient account balance; top up and retry |
| 429 | Too many requests; try again 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.