> ## 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-upload-and-cover-audio.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: '`upload_url` 上传原曲，换成古典钢琴风格并填写新歌词。'
                summary: 上传音频翻唱
                value:
                  model: ai-music-api/upload-and-cover-audio
                  input:
                    upload_url: https://your-cdn.example.com/original.mp3
                    lyrics: |-
                      [Verse]
                      让旋律缓缓流淌
                      走进温柔的桥段
                      [Chorus]
                      让琴声起伏回荡
                    style: Classical, soft piano
                    title: 宁静钢琴冥想
                    instrumental: false
                    model: V6
                    negative_tags: Heavy Metal, Upbeat Drums
                    vocal_gender: f
                    style_weight: 0.65
              翻唱已生成的歌曲（纯音乐）:
                description: '`task_id` + `audio_id` 指定此前生成的一首歌，改编成约 30 秒的爵士钢琴纯音乐，完成后回调。'
                summary: 翻唱已生成的歌曲（纯音乐）
                value:
                  model: ai-music-api/upload-and-cover-audio
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    task_id: c2a81e5f09d34b7e8f61a2d4c9b03e75
                    audio_id: f924248f-e765-48fd-9ea9-c64290225e4e
                    style: Lo-fi jazz piano
                    title: 咖啡翻唱
                    instrumental: true
                    model: V6
                    duration: 30
              只给音频源:
                description: '只传音频源和必填字段，由模型自行改编；`V6_WILD` 风格更大胆，`variety: 2` 让两首差异更明显。'
                summary: 只给音频源
                value:
                  model: ai-music-api/upload-and-cover-audio
                  input:
                    upload_url: https://your-cdn.example.com/demo.wav
                    instrumental: false
                    model: V6_WILD
                    weirdness_constraint: 0.7
                    variety: 2
            schema:
              $ref: '#/components/schemas/SunoCreateTaskRequestSunoUploadCoverInput'
        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 cannot be used together with
                      input.task_id or input.audio_id.
                    data: null
                源任务不可用（422）:
                  description: '`task_id` 不存在、不属于当前账号或不满足 `msg` 中的条件；不建任务、不扣费。'
                  summary: 源任务不可用（422）
                  value:
                    code: 422
                    msg: >-
                      input.task_id must be a succeeded task of this account
                      created in the last 14 days.
                    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:
    SunoCreateTaskRequestSunoUploadCoverInput:
      additionalProperties: false
      description: 创建任务的请求体。
      properties:
        model:
          default: ai-music-api/upload-and-cover-audio
          description: |-
            接口名称，决定 `input` 的字段。

            **可选值：**
            - `ai-music-api/upload-and-cover-audio`：Suno 上传并翻唱音乐
          enum:
            - ai-music-api/upload-and-cover-audio
          type: string
        callBackUrl:
          description: >-
            可选，任务完成（成功或失败）后接收回调的地址，须为公网可访问的 `http` / `https`
            地址；推荐生产环境使用，也可以只轮询查询任务接口。回调格式和签名见“任务完成回调”。
          type: string
        input:
          $ref: '#/components/schemas/SunoUploadCoverInput'
          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
    SunoUploadCoverInput:
      additionalProperties: false
      description: >-
        `ai-music-api/upload-and-cover-audio` 的参数。`instrumental`、`model`
        必填，并需要一个音频源：`upload_url`，或 `task_id` + `audio_id`。
      properties:
        upload_url:
          description: >-
            源音频地址，须为公网可访问的 `http` / `https` 地址，音频不超过 8 分钟。未传 `task_id` +
            `audio_id` 时必填，与二者互斥。
          type: string
        task_id:
          description: >-
            要翻唱的歌曲所在任务的 ID：本账号在 DreamTo 上 14
            天内成功的歌曲任务（生成、续写、翻唱、加人声、加伴奏、替换段落、混音、音效等，createTask 返回的
            `data.taskId`）。须与 `audio_id` 同时传，与 `upload_url`
            互斥。任务不存在、不属于当前账号、未成功、超过 14 天或不产出歌曲时返回 `code: 422`，不建任务、不扣费。
          type: string
        audio_id:
          description: >-
            要翻唱的那首歌的 ID，即源任务查询结果 `response.data[].id`。须与 `task_id` 同时传，与
            `upload_url` 互斥。
          type: string
        prompt:
          description: '可选，歌词，最多 5000 个字符；仅在未传 `lyrics` 时作为歌词使用。`instrumental: true` 时不能传。'
          maxLength: 5000
          type: string
        lyrics:
          description: >-
            可选，翻唱的歌词，最多 5000 个字符，优先于 `prompt`。可用 `[Verse]`、`[Chorus]`
            等标记段落。`instrumental: true` 时不能传。
          maxLength: 5000
          type: string
        style:
          description: 可选，翻唱的音乐风格，最多 1000 个字符，如 `Classical`、`Jazz`、`Lo-fi`。
          maxLength: 1000
          type: string
        title:
          description: 可选，歌名，最多 80 个字符，显示在播放器和文件名中。
          maxLength: 80
          type: string
        instrumental:
          description: >-
            必填，是否生成纯音乐（无人声）。`true` 时不能传 `lyrics`、`prompt`、`vocal_gender`；`false`
            时按 `lyrics`（未传时 `prompt`）演唱。
          type: boolean
        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
        negative_tags:
          description: 可选，要排除的音乐风格或特征，如 `Heavy Metal, Upbeat Drums`。
          type: string
        vocal_gender:
          description: |-
            可选，人声性别偏好。只提高对应性别出现的概率，不保证一定生效。`instrumental: true` 时不能传。

            **可选值：**
            - `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`
            时必须是本账号已就绪的音色（成功的音色验证任务 ID），否则返回 `code: 422`。
          type: string
        persona_model:
          description: |-
            可选，`persona_id` 的类型。

            **可选值：**
            - `style_persona`：风格 Persona：沿用 Persona 的整体音乐风格
            - `voice_persona`：音色 Persona：沿用 Persona 或自定义音色的声音
          enum:
            - style_persona
            - voice_persona
          type: string
        duration:
          description: 可选，目标时长（秒），`10` ~ `360` 的整数；不传时由模型决定。
          format: double
          maximum: 360
          minimum: 10
          multipleOf: 1
          type: number
      required:
        - instrumental
        - 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.