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

# 生成参数模式

> 获取每种生成任务类型的必填和可选字段

此端点帮助您了解在使用 [Generate](/zh/api-reference/suno/generate) 端点时，每种任务类型需要哪些必填或可选参数。

<Tip>
  **推荐工作流程**：在调用 `/generate` 之前，先使用您所需的任务类型调用此端点，以准确了解请求中应包含哪些字段。
</Tip>

## 查询参数

<ParamField query="task" type="string">
  要获取模式的任务类型。如果不提供，则返回所有任务的模式。

  | 值                   | 描述                                                                 |
  | ------------------- | ------------------------------------------------------------------ |
  | `create`            | 从零开始创建新音乐                                                          |
  | `extend`            | 延伸已有音乐                                                             |
  | `upload_extend`     | 延伸已上传的音频                                                           |
  | `upload_cover`      | 翻唱已上传的音频                                                           |
  | `cover`             | 翻唱已有片段                                                             |
  | `use_styles_lyrics` | 使用已有片段的风格搭配新歌词                                                     |
  | `replace_section`   | 替换已有音频的某个段落                                                        |
  | `add_instrumental`  | 为音频添加伴奏                                                            |
  | `add_vocals`        | 为音频添加人声                                                            |
  | `gen_stem_two`      | 生成双轨音轨                                                             |
  | `gen_stem_all`      | 生成所有音轨                                                             |
  | `mashup`            | 混搭两首歌曲                                                             |
  | `sample`            | 从已有片段中采样                                                           |
  | `inspiration`       | 从真实播放列表生成 — 见 [Inspiration 指南](/zh/api-reference/suno/inspiration) |
  | `sound`             | 生成音效                                                               |
</ParamField>

## 响应

返回一个任务模式对象数组，包含以下内容：

<ResponseField name="task" type="string">
  任务类型标识符。
</ResponseField>

<ResponseField name="description" type="string">
  任务的可读描述。
</ResponseField>

<ResponseField name="required" type="array">
  必填字段列表，包含其描述、类型和示例。
</ResponseField>

<ResponseField name="optional" type="array">
  可选字段列表，包含其描述、类型和示例。
</ResponseField>

<ResponseField name="notAllowed" type="array">
  该任务类型会忽略的字段列表。
</ResponseField>

<ResponseField name="example" type="object">
  针对此特定任务的完整请求示例。
</ResponseField>

## 示例

<CodeGroup>
  ```bash cURL (Get all schemas) theme={null}
  curl -X GET "https://api.mountsea.ai/suno/v2/generate/schema" \
    -H "Authorization: Bearer your-api-key"
  ```

  ```bash cURL (Get specific task schema) theme={null}
  curl -X GET "https://api.mountsea.ai/suno/v2/generate/schema?task=extend" \
    -H "Authorization: Bearer your-api-key"
  ```

  ```javascript Node.js theme={null}
  // Get schema for extend task
  const response = await fetch('https://api.mountsea.ai/suno/v2/generate/schema?task=extend', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer your-api-key'
    }
  });

  const schemas = await response.json();
  console.log(schemas);
  ```

  ```python Python theme={null}
  import requests

  # Get schema for create task
  response = requests.get(
      'https://api.mountsea.ai/suno/v2/generate/schema',
      params={'task': 'create'},
      headers={'Authorization': 'Bearer your-api-key'}
  )

  schemas = response.json()
  print(schemas)
  ```
</CodeGroup>

## 响应示例

```json theme={null}
[
  {
    "task": "extend",
    "description": "Extend existing music",
    "required": [
      {
        "field": "clip_id",
        "description": "Source clip ID",
        "example": "clip_abc123",
        "type": "string"
      }
    ],
    "optional": [
      {
        "field": "continue_at",
        "description": "Continue position in seconds",
        "example": 30,
        "type": "number"
      },
      {
        "field": "tags",
        "description": "Style tags",
        "example": "Pop, Happy",
        "type": "string"
      },
      {
        "field": "prompt",
        "description": "Lyrics or prompt text",
        "example": "[Verse]\nHello world...",
        "type": "string"
      }
    ],
    "notAllowed": [
      "range",
      "audio_url"
    ],
    "example": {
      "task": "extend",
      "model": "chirp-v55",
      "clip_id": "clip_abc123",
      "continue_at": 30,
      "tags": "Pop, Happy"
    }
  }
]
```

## 任务类型概览

| 任务                  | 描述        | 关键必填字段                                                                          |
| ------------------- | --------- | ------------------------------------------------------------------------------- |
| `create`            | 创建新音乐     | `model`                                                                         |
| `extend`            | 延伸已有片段    | `clip_id`, `model`                                                              |
| `upload_extend`     | 延伸已上传的音频  | `audio_url`, `model`                                                            |
| `upload_cover`      | 翻唱已上传的音频  | `audio_url`, `model`                                                            |
| `cover`             | 翻唱已有片段    | `clip_id`, `model`                                                              |
| `use_styles_lyrics` | 使用风格搭配新歌词 | `clip_id`, `model`                                                              |
| `replace_section`   | 替换音频段落    | `clip_id`, `range`, `infill_context_range`, `continued_aligned_prompt`, `model` |
| `add_instrumental`  | 添加伴奏      | `clip_id`, `range`, `model`                                                     |
| `add_vocals`        | 添加人声      | `clip_id`, `range`, `model`                                                     |
| `gen_stem_two`      | 双轨音轨分离    | `clip_id`, `model`                                                              |
| `gen_stem_all`      | 全部音轨分离    | `clip_id`, `model`                                                              |
| `mashup`            | 混搭两首歌曲    | `mashup_clip_ids`, `model`                                                      |
| `sample`            | 从已有片段中采样  | `clip_id`, `range`, `model`                                                     |
| `inspiration`       | 从真实播放列表生成 | `playlist_id`, `model` — 见 [Inspiration 指南](/zh/api-reference/suno/inspiration) |
| `sound`             | 生成音效      | `sound`, `model`                                                                |

<Info>
  所有任务都需要 `task` 和 `model` 字段。使用此端点获取每种特定任务类型的完整必填和可选字段列表。
</Info>
