> ## 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.

# 剪輯與改造

> crop/removeSection/fadeIn/fadeOut/adjustSpeed/replaceMusic/sample/mashup/concat/coverSong/remaster

剪輯與改造類操作,全部以已有任務為源:

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

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

## 時間段剪輯(\$0.008 / 次)

| operation | 說明 | 額外必填 |
| - | - | - |
| `crop` | 截取時間段保留 | `start_s`、`end_s` |
| `removeSection` | 刪除時間段 | `start_s`、`end_s` |

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

## 淡入淡出(\$0.008 / 次)

| operation | 說明 | 額外必填 |
| - | - | - |
| `fadeIn` | 開頭淡入 | `duration_s` |
| `fadeOut` | 結尾淡出 | `duration_s` |

## adjustSpeed — 變速(\$0.024)

<ParamField body="speed" type="number" required>速度倍率,如 `0.8` / `1.25`</ParamField>
<ParamField body="keep_pitch" type="boolean">變速時保持音調</ParamField>

## 換寫與重製

### replaceMusic — 片段換寫($0.05,Max $0.10)

<ParamField body="start_s" type="number" required>換寫起點(秒)</ParamField>
<ParamField body="end_s" type="number" required>換寫終點(秒)</ParamField>
<ParamField body="infill_lyrics" type="string">該片段的新歌詞</ParamField>
<ParamField body="max_mode" type="boolean">Max 檔(本操作無 `custom`,直接生效)</ParamField>

### sample — 採樣重編排($0.05,Max $0.10)

<Warning>`task_id` 必須是 `uploadTask` 產物,其他源會被拒絕。</Warning>

<ParamField body="start_s" type="number" required>採樣起點(秒)</ParamField>
<ParamField body="end_s" type="number" required>採樣終點(秒)</ParamField>
<ParamField body="gpt_description" type="string">重編排描述(custom=false 時必填)</ParamField>

### coverSong — 翻唱($0.05,Max $0.10)

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

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

<ParamField body="prompt" type="string">custom=true 時的歌詞</ParamField>
<ParamField body="style" type="string">目標風格</ParamField>

### remaster — 音質重製(\$0.05)

<ParamField body="variation_category" type="string">重製取向(可選)</ParamField>

### mashup — 混編($0.05,Max $0.10)

<ParamField body="task_ids" type="array" required>恰好 2 個源任務 ID</ParamField>
<ParamField body="audio_indexes" type="array">各源任務的曲目序號</ParamField>
<ParamField body="gpt_description" type="string">混編風格描述(custom=false 時必填)</ParamField>

```bash theme={null}
curl --request POST \
  --url https://toapis.com/v1/music/generations/mashup \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{"model":"suno","task_ids":["tsk_aud_aaa","tsk_aud_bbb"],"gpt_description":"blend into seamless lo-fi"}'
```

### concat — 拼接(\$0.004)

拼接 `extend` 產生的分段為完整曲目。

<ParamField body="task_id" type="string" required>`extend` 源任務 ID</ParamField>

## 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.