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

# 查询音色可用性：创建任务

> 同步接口：`model` 选择接口，参数放在 `input` 中，结果直接在响应的 `data` 中返回，无需轮询。所有响应的 HTTP 状态码都是 200，以 `code` 判断结果。



## OpenAPI

````yaml /openapi/zh/suno-voice-check.json post /api/v1/jobs/createTask
openapi: 3.1.0
info:
  description: 查询自定义音色是否已就绪可用；同步返回 `isAvailable`，不建任务、无回调。
  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: >-
        同步接口：`model` 选择接口，参数放在 `input` 中，结果直接在响应的 `data` 中返回，无需轮询。所有响应的 HTTP
        状态码都是 200，以 `code` 判断结果。
      operationId: sunoCreateTask
      requestBody:
        content:
          application/json:
            examples:
              查询音色:
                description: 以生成验证短语任务的 ID（音色 ID）作为 `task_id`，同步返回音色是否可用。
                summary: 查询音色
                value:
                  model: ai-music-api/check-voice
                  input:
                    task_id: c2a81e5f09d34b7e8f61a2d4c9b03e75
            schema:
              $ref: '#/components/schemas/SunoCreateTaskRequestSunoVoiceCheckInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                创建成功:
                  description: 同步返回结果，`data` 即本次结果。
                  summary: 创建成功
                  value:
                    code: 200
                    data:
                      isAvailable: true
                    msg: success
                参数错误（422）:
                  description: 参数不合法，不建任务、不扣费。
                  summary: 参数错误（422）
                  value:
                    code: 422
                    msg: input.task_id is required.
                    data: null
                源任务不可用（422）:
                  description: '`task_id` 不存在、不属于当前账号或不满足 `msg` 中的条件；不建任务、不扣费。'
                  summary: 源任务不可用（422）
                  value:
                    code: 422
                    msg: >-
                      input.task_id must be an existing 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/SunoSyncCreateResponse'
          description: >-
            HTTP 状态码始终为 200。`code` 为 `200` 时创建成功，`data.taskId` 为任务 ID；其他 `code`
            为错误，`msg` 为原因，`data` 为 `null`。
          headers:
            X-Request-Id:
              description: 本次请求的 ID，排查问题时请提供。
              schema:
                type: string
components:
  schemas:
    SunoCreateTaskRequestSunoVoiceCheckInput:
      additionalProperties: false
      description: 创建任务的请求体。
      properties:
        model:
          default: ai-music-api/check-voice
          description: |-
            接口名称，决定 `input` 的字段。

            **可选值：**
            - `ai-music-api/check-voice`：Suno 查询音色可用性
          enum:
            - ai-music-api/check-voice
          type: string
        callBackUrl:
          description: >-
            可选，任务完成（成功或失败）后接收回调的地址，须为公网可访问的 `http` / `https`
            地址；推荐生产环境使用，也可以只轮询查询任务接口。回调格式和签名见“任务完成回调”。
          type: string
        input:
          $ref: '#/components/schemas/SunoVoiceCheckInput'
          description: 任务参数，字段由 `model` 决定。
      required:
        - model
        - input
      type: object
    SunoSyncCreateResponse:
      additionalProperties: false
      description: 同步接口创建任务的响应，`data` 即为结果。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/SunoVoiceCheckData'
          description: 成功时为本次结果；错误时为 `null`。
      required:
        - code
        - msg
        - data
      type: object
    SunoVoiceCheckInput:
      additionalProperties: false
      description: '`ai-music-api/check-voice` 的参数。'
      properties:
        task_id:
          description: >-
            必填，音色 ID：本账号在 DreamTo 上 14
            天内的生成验证短语（`ai-music-api/validation-phrase`）任务 ID（createTask 返回的
            `data.taskId`，等待录音的处理中任务也可以），也是创建音色任务 `resultJson.resultUrls[0]`
            中返回的 ID。传创建音色任务自身的 ID 时返回 `isAvailable: false`。任务不存在、不属于当前账号、超过 14
            天或不是验证短语 / 创建音色任务时返回 `code: 422`，不扣费。
          type: string
      required:
        - task_id
      type: object
    SunoVoiceCheckData:
      additionalProperties: false
      description: 音色可用性结果。
      properties:
        isAvailable:
          description: >-
            `true`：音色已就绪，可在生成音乐等接口以 `persona_id` + `persona_model:
            "voice_persona"` 使用；`false`：音色不可用（如录音未通过验证，或传入的是创建音色任务的 ID）。
          type: boolean
      required:
        - isAvailable
      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.