全量分轨
- 把已有歌曲拆成全部独立音轨,异步任务
- 鼓、贝斯、吉他、键盘、人声各一条
- 需要做二次编曲或混音时用这个
认证
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请求参数
音频模型,默认 suno。当前只有这一个取值。
此前产出源音轨那次任务的 task_id。
缺失或无法解析到源音轨时,提交阶段就返回 400,不会建任务也不扣费。
指定源任务结果 data.result.music[] 里的第几首,从 1 起,默认 1。
一次生成通常产出 2 首,所以要明确指定是哪一首。
输出音频格式,取值 mp3、m4a、wav。
The audio model; defaults to suno, currently the only value.
The task_id of the task that produced the source track.
Missing, or when the source track can't be resolved, returns a 400 at submission — no task is created and nothing is charged.
Which track in the source task's data.result.music[], counting from 1, default 1.
A single generation usually yields 2, so be explicit about which one you mean.
Output audio format: mp3, m4a, or wav.
不接受的参数
这几个字段传了也不会生效:
| 字段 | 说明 |
|---|---|
version | 本端点没有版本维度,传了会被丢弃,也不影响计费 |
stem_type | 本接口不发送该字段 |
| Max 相关字段 | 本接口不发送 |
引用源音轨只靠 task_id 加 audio_index,不需要记录任何额外的 id。不要试图传 audio_id、music_id 或 audio_url,那些都不认。
These fields have no effect if passed:
| Field | Notes |
|---|---|
version | This endpoint has no version dimension; the value is discarded and billing is unaffected |
stem_type | This endpoint doesn't send the field |
| Max-related fields | This endpoint doesn't send them |
Referencing the source track relies only on task_id plus audio_index; no extra id needs recording. Don't try passing audio_id, music_id, or audio_url — none of them are recognised.
提交响应
状态码,成功为 200。
提交成功时为 submitted。
任务唯一标识,用于轮询 GET /v1/music/tasks/{task_id}。
The status code; 200 on success.
submitted after successful submission.
The unique task identifier, used to poll GET /v1/music/tasks/{task_id}.
任务状态
轮询间隔建议 3 到 5 秒,直到 status 变为 completed 或 failed。
状态取值:pending、processing、completed、failed。progress 是 0 到 100 的整数,变化节点不固定。
完成时结果里包含各分轨的 URL。失败时 data.error.message 给出原因,并自动退回预扣额度。
Poll every 3 to 5 seconds until status becomes completed or failed.
Possible values: pending, processing, completed, failed. progress is an integer from 0 to 100 and isn't guaranteed to change on fixed steps.
On completion the result contains a URL for each stem. On failure, data.error.message gives the reason and the held balance is refunded automatically.
错误
| HTTP | type | 说明 |
|---|---|---|
| 400 | invalid_request_error | 请求参数无效 |
| 401 | authentication_error | 身份验证失败,请检查您的API密钥 |
| 402 | payment_required | 账户余额不足,请充值后再试 |
| 429 | rate_limit_error | 请求过于频繁,请稍后再试 |
| HTTP | type | Notes |
|---|---|---|
| 400 | invalid_request_error | Invalid request parameters |
| 401 | authentication_error | Authentication failed; check your API key |
| 402 | payment_required | Insufficient account balance; top up and retry |
| 429 | rate_limit_error | 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.