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

# 添加人声：创建任务

> 创建 Suno 任务：`model` 选择接口，参数放在 `input` 中，可选 `callBackUrl` 接收完成回调。成功后返回 `data.taskId`，任务在后台异步执行，用查询任务接口轮询结果。所有响应的 HTTP 状态码都是 200，以 `code` 判断结果。



## OpenAPI

````yaml /openapi/zh/suno-add-vocals.json post /api/v1/jobs/createTask
openapi: 3.1.0
info:
  description: 为一段已有的伴奏或纯音乐配上人声演唱，可指定歌名、风格、歌词和人声性别；每次生成两首。
  title: Suno 添加人声
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Suno 添加人声
paths:
  /api/v1/jobs/createTask:
    post:
      tags:
        - Suno 添加人声
      summary: 创建任务
      description: >-
        创建 Suno 任务：`model` 选择接口，参数放在 `input` 中，可选 `callBackUrl` 接收完成回调。成功后返回
        `data.taskId`，任务在后台异步执行，用查询任务接口轮询结果。所有响应的 HTTP 状态码都是 200，以 `code` 判断结果。
      operationId: sunoCreateTask
      requestBody:
        content:
          application/json:
            examples:
              按歌词添加人声:
                description: 为钢琴伴奏配上男声，按给定歌词演唱。
                summary: 按歌词添加人声
                value:
                  model: ai-music-api/add-vocals
                  input:
                    upload_url: https://example.com/music.mp3
                    lyrics: |-
                      [Verse]
                      让旋律缓缓流淌
                      走进温柔的桥段
                      [Chorus]
                      让钢琴起伏回荡
                    model: V6
                    title: 轻柔钢琴
                    negative_tags: heavy metal, strong drum beats
                    style: Jazz
                    vocal_gender: m
                    style_weight: 0.61
                    weirdness_constraint: 0.72
                    audio_weight: 0.65
                    variety: 1
              只填必填项:
                description: 只提供源音频、歌名、风格和排除风格，歌词由模型创作，完成后回调。
                summary: 只填必填项
                value:
                  model: ai-music-api/add-vocals
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    upload_url: https://example.com/beat.mp3
                    title: 夏夜
                    negative_tags: rap
                    style: R&B, smooth female vocals
              用描述作为歌词:
                description: 未传 `lyrics` 时以 `prompt` 作为歌词；`V6_MINI` 速度更快，女声演唱。
                summary: 用描述作为歌词
                value:
                  model: ai-music-api/add-vocals
                  input:
                    upload_url: https://example.com/acoustic.mp3
                    prompt: 一首关于清晨咖啡的轻快歌曲
                    model: V6_MINI
                    title: 早安咖啡
                    negative_tags: heavy metal
                    style: acoustic folk-pop
                    vocal_gender: f
            schema:
              $ref: '#/components/schemas/SunoCreateTaskRequestSunoAddVocalsInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                创建成功:
                  description: '`data.taskId` 为任务 ID。'
                  summary: 创建成功
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                参数错误（422）:
                  description: 参数不合法，不建任务、不扣费。
                  summary: 参数错误（422）
                  value:
                    code: 422
                    msg: input.upload_url is required.
                    data: null
                未授权（401）:
                  description: API Key 缺失或无效。
                  summary: 未授权（401）
                  value:
                    code: 401
                    msg: >-
                      Unauthorized - Authentication credentials are missing or
                      invalid
                    data: null
                余额不足（402）:
                  description: 余额不足以支付本次任务。
                  summary: 余额不足（402）
                  value:
                    code: 402
                    msg: >-
                      Insufficient Credits - Account does not have enough
                      credits to perform the operation
                    data: null
                请求过于频繁（429）:
                  description: 超过频率限制，请稍后重试。
                  summary: 请求过于频繁（429）
                  value:
                    code: 429
                    msg: >-
                      Rate Limited - Request limit has been exceeded for this
                      resource
                    data: null
                服务器错误（500）:
                  description: 服务暂时不可用，可稍后重试，不扣费。
                  summary: 服务器错误（500）
                  value:
                    code: 500
                    msg: >-
                      Server Error - An unexpected error occurred while
                      processing the request
                    data: null
              schema:
                $ref: '#/components/schemas/SunoCreateTaskResponse'
          description: >-
            HTTP 状态码始终为 200。`code` 为 `200` 时创建成功，`data.taskId` 为任务 ID；其他 `code`
            为错误，`msg` 为原因，`data` 为 `null`。
          headers:
            X-Request-Id:
              description: 本次请求的 ID，排查问题时请提供。
              schema:
                type: string
components:
  schemas:
    SunoCreateTaskRequestSunoAddVocalsInput:
      additionalProperties: false
      description: 创建任务的请求体。
      properties:
        model:
          default: ai-music-api/add-vocals
          description: |-
            接口名称，决定 `input` 的字段。

            **可选值：**
            - `ai-music-api/add-vocals`：Suno 添加人声
          enum:
            - ai-music-api/add-vocals
          type: string
        callBackUrl:
          description: >-
            可选，任务完成（成功或失败）后接收回调的地址，须为公网可访问的 `http` / `https`
            地址；推荐生产环境使用，也可以只轮询查询任务接口。回调格式和签名见“任务完成回调”。
          type: string
        input:
          $ref: '#/components/schemas/SunoAddVocalsInput'
          description: 任务参数，字段由 `model` 决定。
      required:
        - model
        - input
      type: object
    SunoCreateTaskResponse:
      additionalProperties: false
      description: 创建任务的响应。HTTP 状态码始终为 200。
      properties:
        code:
          description: |-
            结果代码：
            - `200`：成功
            - `401`：API Key 缺失或无效
            - `402`：余额不足
            - `404`：模型不存在或未开通
            - `405`：请求方法错误
            - `422`：参数错误，`msg` 为原因，不建任务、不扣费
            - `429`：请求过于频繁，请稍后重试
            - `455`：服务维护中
            - `500`：服务器错误，可稍后重试
            - `501`：生成失败
            - `505`：功能已停用
          format: int64
          type: integer
        msg:
          description: 结果说明：成功时为 `success`，错误时为英文原因。
          type: string
        data:
          $ref: '#/components/schemas/SunoCreateTaskData'
          description: 成功时为任务信息；错误时为 `null`。
      required:
        - code
        - msg
        - data
      type: object
    SunoAddVocalsInput:
      additionalProperties: false
      description: >-
        `ai-music-api/add-vocals`
        的参数。`upload_url`、`title`、`negative_tags`、`style` 必填，其他字段可选。
      properties:
        upload_url:
          description: 必填，源音频（伴奏或纯音乐）的地址，须为公网可访问的 `http` / `https` 地址。
          type: string
        prompt:
          description: 可选，最多 5000 个字符。未传 `lyrics` 时作为歌词演唱；传了 `lyrics` 时不作为歌词使用。
          maxLength: 5000
          type: string
        lyrics:
          description: 可选，歌词，最多 5000 个字符，优先于 `prompt` 作为歌词。可用 `[Verse]`、`[Chorus]` 等标记段落。
          maxLength: 5000
          type: string
        model:
          default: V6
          description: |-
            可选，Suno 模型版本：`V6`（默认）、`V6_MINI` 或 `V6_WILD`。已下线的 V4 ~ V5_5 不再支持。

            **可选值：**
            - `V6`：Suno V6：音乐表现力更强，人声更自然，细节更丰富
            - `V6_MINI`：Suno V6 Mini：轻量快速，兼顾质量与速度
            - `V6_WILD`：Suno V6 Wild：突破创作边界，表达更大胆、更有个性
          enum:
            - V6
            - V6_MINI
            - V6_WILD
          type: string
        title:
          description: 必填，歌名，显示在播放器和文件名中。
          minLength: 1
          type: string
        negative_tags:
          description: 必填，要排除的音乐风格或元素，最多 200 个字符，如 `heavy metal, strong drum beats`。
          maxLength: 200
          minLength: 1
          type: string
        style:
          description: 必填，音乐风格，最多 1000 个字符，如 `Jazz`、`Electronic`、`Classical`。
          maxLength: 1000
          minLength: 1
          type: string
        vocal_gender:
          description: |-
            可选，人声性别偏好。只提高对应性别出现的概率，不保证一定生效。

            **可选值：**
            - `m`：男声
            - `f`：女声
          enum:
            - m
            - f
          type: string
        style_weight:
          description: 可选，对 `style` 的遵循强度，`0` ~ `1`，最多 2 位小数。
          format: double
          maximum: 1
          minimum: 0
          multipleOf: 0.01
          type: number
        weirdness_constraint:
          description: 可选，创意 / 实验性偏离程度，`0` ~ `1`，最多 2 位小数；越大越大胆。
          format: double
          maximum: 1
          minimum: 0
          multipleOf: 0.01
          type: number
        audio_weight:
          description: 可选，音频特征的相对权重，`0` ~ `1`，最多 2 位小数。
          format: double
          maximum: 1
          minimum: 0
          multipleOf: 0.01
          type: number
        variety:
          default: 1
          description: >-
            可选，结果的多样性，`0` ~ `4` 的整数，默认 `1`：`0` 关闭（严格保持风格）、`1` 正常（兼顾稳定与多样）、`2`
            高（风格明显不同）、`3` 更高（大胆探索）、`4` 最大（差异可能非常大）。
          format: double
          maximum: 4
          minimum: 0
          multipleOf: 1
          type: number
      required:
        - upload_url
        - title
        - negative_tags
        - style
      type: object
    SunoCreateTaskData:
      additionalProperties: false
      description: 新建的任务。
      properties:
        taskId:
          description: 任务 ID（32 位十六进制），用于查询任务，也作为后续接口的 `task_id`。
          type: string
      required:
        - taskId
      type: object
  securitySchemes:
    bearerAuth:
      description: 'DreamTo 控制台创建的 API Key，格式 `Authorization: Bearer <API Key>`。'
      scheme: bearer
      type: http

````

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