# Suno Voice 自建音色生成

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/voice/generate:
    post:
      summary: Suno Voice 自建音色生成
      deprecated: false
      description: >
        根据用户录制的验证短句音频生成可复用的 Suno 自建音色。


        ### 使用指南


        - 请在验证短句生成完成，并且用户已完成验证音频录制后调用此接口。

        - 验证短句是服务端返回的 `validateInfo` 文本。为获得更佳的音色生成效果，建议用户以演唱方式录制服务端返回的验证短句。

        - 提交原验证任务的 `taskId`，并在 `verifyUrl` 中传入验证音频 URL。

        - 可选的 `voiceName`、`description`、`style` 和 `singerSkillLevel`
        可帮助管理并调整生成的音色。

        - 接口会返回新的 `taskId`，后续通过它查询最终 `voiceId`。

        - 如果传入 `callBackUrl`，系统会在音色创建完成或任务失败时发送 POST 回调。回调地址必须可公网访问，并在 15 秒内返回
        HTTP 200。


        ### 流程


        1. 生成并获取验证短句。

        2. 录制用户完成该短句的验证音频；为获得更佳的音色生成效果，建议采用演唱方式录制。

        3. 上传或托管验证音频，并将 URL 作为 `verifyUrl` 传入。

        4. 提交音色生成任务，并保存返回的 `taskId`。

        5. 任务成功后，通过查询接口或回调获取 `voiceId`。


        ### 回调


        <Card

        title="自建音色生成回调"

        icon="lucide-webhook"

        href="/cn/suno-api/suno-voice-generate-callbacks"

        >

        查看音色创建完成或失败时发送的回调格式

        </Card>


        ### 开发者注意事项


        - `taskId` 必须来自同一音色流程中的验证短句任务。

        - `verifyUrl` 应指向用户录制服务端返回的同一条验证短句的音频；为获得更佳效果，建议采用演唱方式录制。

        - 获取 `voiceId` 后，建议先调用音色可用性检查接口，再用于依赖自建音色的生成流程。
      operationId: suno-voice-generate
      tags:
        - docs/zh-CN/Suno API/Suno Voice
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                taskId:
                  description: 任务task_id
                  type: string
                verifyUrl:
                  description: 用户录制服务端返回的验证短句后的音频URL；为获得更佳效果，建议采用演唱方式录制[必填]
                  type: string
                voiceName:
                  description: 音色名称
                  type: string
                description:
                  description: 音色描述
                  type: string
                style:
                  description: 音色风格
                  type: string
                singerSkillLevel:
                  type: string
                  description: 歌手技能等级。支持：beginner、intermediate、advanced、professional
                  default: beginner
                  enum:
                    - beginner
                    - intermediate
                    - advanced
                    - professional
                  x-apidog-enum:
                    - value: beginner
                      name: ''
                      description: ''
                    - value: intermediate
                      name: ''
                      description: ''
                    - value: advanced
                      name: ''
                      description: ''
                    - value: professional
                      name: ''
                      description: ''
                callBackUrl:
                  description: >-
                    用于接收自建音色生成结果的回调地址。任务成功时，回调中会包含生成的 `voiceId`；任务失败时会包含
                    `errorCode` 和 `errorMessage`。该地址必须可公网访问，并在 15 秒内返回 HTTP
                    200。回调数据格式请参考
                    [自建音色生成回调](https://docs.sunoapi.org/cn/suno-api/suno-voice-generate-callbacks)。
                  type: string
              required:
                - taskId
                - verifyUrl
              x-apidog-orders:
                - taskId
                - verifyUrl
                - voiceName
                - description
                - style
                - singerSkillLevel
                - callBackUrl
            example:
              taskId: voice_create_001
              verifyUrl: https://example.com/audio/verify_read.mp3
              voiceName: My Voice
              description: created from uploaded voice
              style: Pop, Female Vocal
              singerSkillLevel: beginner
              callBackUrl: https://example.com/callback/suno/voice_create
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      taskId:
                        description: 任务id
                        type: string
                    required:
                      - taskId
                    x-apidog-orders:
                      - taskId
                required:
                  - code
                  - msg
                  - data
                x-apidog-orders:
                  - code
                  - msg
                  - data
              example:
                code: 200
                msg: success
                data:
                  taskId: xxx_task_id_xxx
          headers: {}
          x-apidog-name: 成功
      security: []
      x-apidog-folder: docs/zh-CN/Suno API/Suno Voice
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1412907/apis/api-46842379-run
components:
  schemas: {}
  securitySchemes:
    BearerAuth:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: >-
        # 🔑 API Authentication


        All endpoints require authentication using Bearer Token.


        ## Get API Key


        1. Visit the [API Key Management Page](https://sunoapi.org/api-key) to
        obtain your API Key


        ## Usage


        Add to request headers:


        ```

        Authorization: Bearer YOUR_API_KEY

        ```


        > **⚠️ Note:**

        > - Keep your API Key secure and do not share it with others

        > - If you suspect your API Key has been compromised, reset it
        immediately from the management page
servers:
  - url: https://apibox.erweima.ai
    description: 正式环境
security: []

```
