> ## 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-voice-create.json post /api/v1/jobs/createTask
openapi: 3.1.0
info:
  description: 提交用户朗读验证短语的录音，校验通过后生成可复用的自定义音色（Voice）。
  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: 传入验证短语任务的 `task_id` 与录音地址，并附上音色信息。
                summary: 提交验证录音
                value:
                  model: ai-music-api/create-voice
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    task_id: c2a81e5f09d34b7e8f61a2d4c9b03e75
                    verify_url: https://example.com/recordings/verify-phrase.mp3
                    voice_name: 我的声音
                    description: 温暖明亮的女中音
                    style: pop
                    singer_skill_level: intermediate
              只传必填字段:
                description: 只传验证短语任务的 `task_id` 与录音地址。
                summary: 只传必填字段
                value:
                  model: ai-music-api/create-voice
                  input:
                    task_id: c2a81e5f09d34b7e8f61a2d4c9b03e75
                    verify_url: https://example.com/recordings/verify-phrase.mp3
            schema:
              $ref: '#/components/schemas/SunoCreateTaskRequestSunoVoiceCreateInput'
        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.verify_url is required.
                    data: null
                源任务不可用（422）:
                  description: '`task_id` 不存在、不属于当前账号或不满足 `msg` 中的条件；不建任务、不扣费。'
                  summary: 源任务不可用（422）
                  value:
                    code: 422
                    msg: >-
                      input.task_id must be a pending or 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:
    SunoCreateTaskRequestSunoVoiceCreateInput:
      additionalProperties: false
      description: 创建任务的请求体。
      properties:
        model:
          default: ai-music-api/create-voice
          description: |-
            接口名称，决定 `input` 的字段。

            **可选值：**
            - `ai-music-api/create-voice`：Suno 创建自定义音色
          enum:
            - ai-music-api/create-voice
          type: string
        callBackUrl:
          description: >-
            可选，任务完成（成功或失败）后接收回调的地址，须为公网可访问的 `http` / `https`
            地址；推荐生产环境使用，也可以只轮询查询任务接口。回调格式和签名见“任务完成回调”。
          type: string
        input:
          $ref: '#/components/schemas/SunoVoiceCreateInput'
          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
    SunoVoiceCreateInput:
      additionalProperties: false
      description: '`ai-music-api/create-voice` 的参数。'
      properties:
        task_id:
          description: >-
            必填，“生成验证短语”任务的任务 ID（createTask 返回的 `data.taskId`），须为本账号 14
            天内创建、正在等待录音或已成功的验证短语任务；它同时就是 Voice ID。任务不存在、不属于当前账号、已失败、超过 14
            天或不是验证短语任务时返回 `code: 422`，不建任务、不扣费。
          type: string
        verify_url:
          description: >-
            必填，用户朗读验证短语（验证短语任务结果中的 `verify_phrase_text`）的录音地址，须为 `http` /
            `https` 链接。建议用唱的方式读出短语，以获得更好的音色。
          type: string
        voice_name:
          description: 可选，音色名称。
          type: string
        description:
          description: 可选，音色描述。
          type: string
        style:
          description: 可选，音色风格。
          type: string
        singer_skill_level:
          default: beginner
          description: |-
            可选，演唱水平，默认 `beginner`。

            **可选值：**
            - `beginner`：入门
            - `intermediate`：中级
            - `advanced`：高级
            - `professional`：专业
          enum:
            - beginner
            - intermediate
            - advanced
            - professional
          type: string
      required:
        - task_id
        - verify_url
      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.