> ## Documentation Index
> Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 分軌與添加音軌

> stems/stemsAll 分軌,addStem/addVocals/addInstrumental 添加音軌

```
POST https://toapis.com/v1/music/generations/{operation}
```

<ParamField body="model" type="string" required>固定 `"suno"`</ParamField>
<ParamField body="task_id" type="string" required>源任務 ID</ParamField>
<ParamField body="audio_index" type="number">源曲目序號</ParamField>

## 分軌

| operation | 說明 | 價格 |
| - | - | - |
| `stems` | 人聲 / 伴奏兩條分軌 | \$0.10 |
| `stemsAll` | 全樂器分軌(每條樂器一軌) | \$0.24 |

返回 `result.music[]` 中每軌一個 `audio_url`,已鏡像本站 CDN。

```bash theme={null}
curl --request POST \
  --url https://toapis.com/v1/music/generations/stemsAll \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{"model":"suno","task_id":"tsk_aud_xxx"}'
```

## 添加音軌(各 $0.05,Max $0.10)

<Warning>`addVocals`/`addInstrumental`/`addStem` 的 `task_id` 必須是 `uploadTask` 產物。</Warning>

| operation | 說明 |
| - | - |
| `addVocals` | 為上傳素材生成人聲 |
| `addInstrumental` | 為上傳素材生成伴奏 |
| `addStem` | 新增一條樂器軌 |

<ParamField body="gpt_description" type="string">目標描述(custom=false 時必填)</ParamField>

<ParamField body="custom" type="boolean" />

<ParamField body="prompt" type="string">custom=true 時的歌詞</ParamField>
<ParamField body="max_mode" type="boolean">Max 檔</ParamField>

```bash theme={null}
curl --request POST \
  --url https://toapis.com/v1/music/generations/addVocals \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{"model":"suno","task_id":"tsk_aud_upload_task","gpt_description":"add dreamy female vocals"}'
```

## Response

<ResponseField name="task_id" type="string">新任務 ID</ResponseField>
<ResponseField name="status" type="string">`submitted`</ResponseField>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.