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

# Suno API：人声分离

> 从 Suno 音乐曲目中分离出干净的人声、伴奏或按乐器拆分的音轨。

### 重要说明

* 需要来自先前生成的 Suno 音乐任务中的 `task_id` 和 `suno_id`
* 不同的模式会影响任务结果的返回内容
* `mode` 控制你想要的音轨类型：`vocal` 或 `instrumental`
  * `vocal`：2 个音轨 - 人声 + 伴奏
  * `instrumental`：最多 12 个音轨 – 人声、和声、鼓、贝斯、吉他、键盘、弦乐、铜管、
    木管、打击乐、合成器、FX/其他

### 人声分离

从现有 Suno 音乐结果中分离人声或伴奏。

<CodeGroup>
  ```json vocal stem theme={null} theme={null}
  {
      "model": "suno/vocal-separatio",
      "callback_url": "",
      "input": {
          "task_id": "task_12345678",
          "suno_id": "suno_abc123",
          "mode": "vocal"
      }
  }
  ```

  ```json instrumental stem theme={null} theme={null}
  {
      "model": "suno/vocal-separatio",
      "callback_url": "",
      "input": {
          "task_id": "task_12345678",
          "suno_id": "suno_abc123",
          "mode": "instrumental"
      }
  }
  ```
</CodeGroup>

### 相关资源

现有的 Suno 音乐曲目可以来自以下任一接口。

<CardGroup cols={2}>
  <Card title="生成音乐" icon="music" href="/zh/suno-api/generate-music"> 根据文本提示词创建具有多样风格的歌曲。 </Card>
  <Card title="扩展音乐" icon="forward" href="/zh/suno-api/extend-music"> 无缝延续并扩展现有音乐。 </Card>
  <Card title="上传并扩展音乐" icon="upload" href="/zh/suno-api/extend-music-upload"> 上传音频以扩展和优化作品。 </Card>
  <Card title="音乐翻唱" icon="retweet" href="/zh/suno-api/cover-music"> 使用新的风格或声音重新创作歌曲。 </Card>
</CardGroup>

### 获取任务结果

提交任务后，使用统一查询接口检查进度并获取结果：

<Card title="获取人声分离信息" icon="magnifying-glass" href="/zh/suno-api/vocal-separation-task-info">
  了解如何查询人声分离任务状态并获取生成结果
</Card>


## OpenAPI

````yaml zh/suno-api/vocal-separation.json post /api/v1/client/job/CreateTask
openapi: 3.0.0
info:
  title: Crun Suno 人声分离 API
  description: crun.ai Suno 人声分离 API 文档
  version: 1.0.0
  contact:
    name: 技术支持
    email: support@crun.ai
servers:
  - url: https://api.crun.ai
    description: API 服务器
security:
  - ApiKeyAuth: []
paths:
  /api/v1/client/job/CreateTask:
    post:
      summary: Suno 人声分离
      operationId: suno/vocal-separatio
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - suno/vocal-separatio
                  description: |-
                    用于生成的模型名称。必填字段。

                    - 此接口必须使用 `suno/vocal-separatio`
                callback_url:
                  type: string
                  format: uri
                  description: |-
                    可选。用于接收任务完成通知的回调 URL。

                    - 系统会在生成完成后向该 URL POST 任务状态和结果
                    - 回调负载结构与任务状态查询返回的 `data` 对象一致
                    - 你的回调接口应支持接收包含结果的 JSON 负载的 POST 请求
                    - 成功接收后应返回 HTTP 200 状态码
                  example: https://your-domain.com/api/callback
                input:
                  $ref: '#/components/schemas/SunoVocalSeparationInput'
            example:
              model: suno/vocal-separatio
              callback_url: https://your-domain.com/api/callback
              input:
                task_id: task_12345678
                suno_id: suno_abc123
                mode: vocal
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          task_id:
                            type: string
                            description: 任务 ID，可与获取任务详情接口配合使用以查询任务状态
                            example: task_12345678
              example:
                code: 200
                message: success
                data:
                  task_id: task_12345678
        '422':
          description: 验证错误
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      errors:
                        type: array
                        description: 详细的验证错误消息
                        items:
                          type: string
                        example:
                          - 具体错误字段信息
              example:
                code: 422
                message: 缺少参数或类型错误
                errors:
                  - 具体错误字段信息
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    SunoVocalSeparationInput:
      type: object
      description: |-
        用于分离人声和伴奏的输入参数。

        规则：
        - `task_id` 为必填项，且必须引用一个已完成的 Suno 音乐任务。
        - `suno_id` 为必填项，且必须引用该任务中的音乐项目。
        - `mode` 默认值为 `vocal`。
      properties:
        task_id:
          type: string
          description: 音乐生成任务的任务 ID。
          example: task_12345678
        suno_id:
          type: string
          description: Suno 歌曲 ID。
          example: suno_abc123
        mode:
          type: string
          enum:
            - vocal
            - instrumental
          description: >-
            分离模式，不同模式会影响任务结果的返回内容。


            - **vocal**：提取人声 + 伴奏音轨。

            - **instrumental**：最多提取 12 个音轨 –
            人声、和声、鼓、贝斯、吉他、键盘、弦乐、铜管、木管、打击乐、合成器、FX/其他
          default: vocal
          example: vocal
      required:
        - task_id
        - suno_id
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          enum:
            - 200
            - 401
            - 402
            - 404
            - 422
            - 429
            - 455
            - 500
            - 501
            - 505
          description: |-
            响应状态码

            - **200**：成功 - 请求已成功处理
            - **401**：未授权 - 身份验证凭证缺失或无效
            - **402**：积分不足 - 账户没有足够的积分执行该操作
            - **404**：未找到 - 请求的资源或接口不存在
            - **422**：验证错误 - 请求参数未通过验证检查
            - **429**：请求频率受限 - 已超过该资源的请求限制
            - **455**：服务不可用 - 系统当前正在维护
            - **500**：服务器错误 - 处理请求时发生意外错误
            - **501**：生成失败 - 内容生成任务失败
            - **505**：功能已禁用 - 请求的功能当前已被禁用
        message:
          type: string
          description: 响应消息，失败时为错误描述
          example: success
  responses:
    Error:
      description: 服务器错误
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: |-
        所有 API 都需要通过 API Key 进行身份验证。

        获取 API Key：
        1. 访问 [API Key 管理页面](https://crun.ai/zh/user-api-key) 获取你的 API Key

        使用方式：
        添加到请求头：

        x-api-key: YOUR_API_KEY

        注意：
        - 请妥善保管你的 API Key，不要与他人共享
        - 如果你怀疑 API Key 已泄露，请立即在管理页面中重置

````