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

# 混音创作（Mashup）：创建任务

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



## OpenAPI

````yaml /openapi/zh/suno-mashup.json post /api/v1/jobs/createTask
openapi: 3.1.0
info:
  description: 把两段音频的元素融合成一首全新的歌曲，可指定歌名、风格和歌词；每次生成两首。
  title: Suno 混音创作（Mashup）
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Suno 混音创作（Mashup）
paths:
  /api/v1/jobs/createTask:
    post:
      tags:
        - Suno 混音创作（Mashup）
      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/mashup
                  input:
                    upload_url_list:
                      - https://example.com/audio1.mp3
                      - https://example.com/audio2.mp3
                    style: 原声民谣流行
                    title: 清晨混音
                    model: V6
              自定义歌词与细节:
                description: 写入新歌词，指定男声、风格强度、创意程度、音频权重和时长，完成后回调。
                summary: 自定义歌词与细节
                value:
                  model: ai-music-api/mashup
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    upload_url_list:
                      - https://example.com/audio1.mp3
                      - https://example.com/audio2.mp3
                    lyrics: |-
                      [Verse]
                      让旋律缓缓流淌
                      融进温柔的桥段
                      [Chorus]
                      让钢琴起伏回荡
                    style: Jazz
                    title: 轻柔钢琴
                    model: V6
                    vocal_gender: m
                    style_weight: 0.61
                    weirdness_constraint: 0.72
                    audio_weight: 0.65
                    variety: 1
                    duration: 20
              大胆融合:
                description: '`V6_WILD` 搭配 `variety: 3`，让两首结果风格差异更大。'
                summary: 大胆融合
                value:
                  model: ai-music-api/mashup
                  input:
                    upload_url_list:
                      - https://example.com/audio1.mp3
                      - https://example.com/audio2.mp3
                    prompt: |-
                      [Verse]
                      灯光亮起我们一起摇摆
                    style: electro swing, brass, upbeat
                    title: 复古舞池
                    model: V6_WILD
                    variety: 3
            schema:
              $ref: '#/components/schemas/SunoCreateTaskRequestSunoMashupInput'
        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_list must contain at least 2 items.
                    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:
    SunoCreateTaskRequestSunoMashupInput:
      additionalProperties: false
      description: 创建任务的请求体。
      properties:
        model:
          default: ai-music-api/mashup
          description: |-
            接口名称，决定 `input` 的字段。

            **可选值：**
            - `ai-music-api/mashup`：Suno 混音创作（Mashup）
          enum:
            - ai-music-api/mashup
          type: string
        callBackUrl:
          description: >-
            可选，任务完成（成功或失败）后接收回调的地址，须为公网可访问的 `http` / `https`
            地址；推荐生产环境使用，也可以只轮询查询任务接口。回调格式和签名见“任务完成回调”。
          type: string
        input:
          $ref: '#/components/schemas/SunoMashupInput'
          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
    SunoMashupInput:
      additionalProperties: false
      description: '`ai-music-api/mashup` 的参数。`upload_url_list`、`model`、`style`、`title` 必填。'
      properties:
        upload_url_list:
          description: 必填，要混音的音频地址列表，至少 2 个，只使用前 2 个；每个都须为公网可访问的 `http` / `https` 地址。
          items:
            type: string
          minItems: 2
          type: array
        prompt:
          description: 可选，歌曲内容描述，最多 5000 个字符；仅在未传 `lyrics` 时作为歌词使用。
          maxLength: 5000
          type: string
        lyrics:
          description: >-
            可选，混音歌曲的歌词，最多 5000 个字符，优先于 `prompt` 作为歌词。可用 `[Verse]`、`[Chorus]`
            等标记段落。
          maxLength: 5000
          type: string
        style:
          description: >-
            必填，音乐风格，最多 1000 个字符，如
            `Jazz`、`Classical`、`Electronic`、`Pop`、`Rock`、`Hip-hop`。
          maxLength: 1000
          type: string
        title:
          description: 必填，歌名，最多 100 个字符，显示在播放器和文件名中。
          maxLength: 100
          type: string
        model:
          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
        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
        persona_id:
          description: >-
            可选，Persona ID 或 Voice ID，让生成的音乐沿用该 Persona 的风格或该自定义音色。Persona 由“生成
            Persona”接口创建，Voice 由“自定义音色”接口创建。`persona_model` 为 `voice_persona`
            时，必须是本账户已就绪的音色（成功的 validation-phrase 任务 ID）。
          type: string
        persona_model:
          description: |-
            可选，`persona_id` 的类型。默认 `style_persona`。

            **可选值：**
            - `style_persona`：风格 Persona：沿用 Persona 的整体音乐风格
            - `voice_persona`：音色 Persona：沿用 Persona 或自定义音色的声音
          enum:
            - style_persona
            - voice_persona
          type: string
        duration:
          default: 20
          description: 可选，目标时长（秒），`10` ~ `360` 的整数，默认 `20`；实际时长可能不同。
          format: double
          maximum: 360
          minimum: 10
          multipleOf: 1
          type: number
      required:
        - upload_url_list
        - style
        - title
        - model
      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.