# 生成声音

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/generate/sounds:
    post:
      summary: 生成声音
      deprecated: false
      description: >
        创建 Sounds 生成任务，支持循环、BPM、调性和歌词字幕抓取等参数。


        ### 模型版本


        - **当前模型**：`V6`（默认）、`V6_WILD`、`V6_MINI`

        - **已废弃模型**：`V5_5`、`V5`、`V4_5PLUS`、`V4_5ALL`、`V4_5`、`V4`

        - 废弃值仅为向后兼容保留，新接入请使用 V6 系列模型。


        用于创建声音生成任务（Sounds Task）。支持设置循环播放、节奏（BPM）、调性（Key）以及歌词字幕抓取等能力。


        ## 🚀 使用指南


        - 使用该接口可以基于输入的 `prompt` 生成对应的音频内容。

        - 支持设置循环播放效果，适用于背景音乐、环境音等场景。

        - 支持指定 BPM（每分钟节拍数）和 Key（调性），便于控制生成结果的风格。

        - 可选开启歌词字幕抓取，便于后续展示或处理歌词内容。

        - 支持通过回调地址异步接收任务完成通知。


        ### `model` 参数


        -
        允许取值：`V6`、`V6_WILD`、`V6_MINI`。已废弃：`V5`、`V5_5`、`V4_5PLUS`、`V4_5ALL`、`V4_5`、`V4`。

        - **V6、V6_WILD 和 V6_MINI**：当前 Sounds 模型，默认使用 `V6`。旧模型值已废弃，仅为向后兼容保留。


        ## 📌 适用场景


        - 🎧 背景音乐创作

        - 🎮 游戏音效或循环环境声生成

        - 🌐 音频内容平台与创作工具集成
      operationId: generate-sounds
      tags:
        - docs/zh-CN/Suno API/Generate Sounds
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
                - model
              properties:
                prompt:
                  type: string
                  description: sounds 任务提示词，最多 500 字符。
                  maxLength: 500
                  examples:
                    - 轻柔的雨声环境音，带有远处雷声和微风
                model:
                  type: string
                  description: >-
                    AI 模型版本。默认值：`V6`。

                    - **`V6`**：当前标准模型，推荐默认使用。

                    - **`V6_WILD`**：当前实验性、创造性更强的模型。

                    - **`V6_MINI`**：当前轻量模型。

                    -
                    **已废弃**：`V5_5`、`V5`、`V4_5PLUS`、`V4_5ALL`、`V4_5`、`V4`。这些值仅为向后兼容保留，新接入请使用
                    V6 系列模型。
                  enum:
                    - V6
                    - V6_WILD
                    - V6_MINI
                    - V5_5
                    - V5
                    - V4_5PLUS
                    - V4_5ALL
                    - V4_5
                    - V4
                  default: V6
                  examples:
                    - V6
                soundLoop:
                  type: boolean
                  description: 是否循环播放。
                  default: false
                  examples:
                    - false
                soundTempo:
                  type: integer
                  description: BPM（每分钟节拍数），不传则为 Auto。
                  minimum: 1
                  maximum: 300
                  examples:
                    - 120
                  nullable: true
                soundKey:
                  type: string
                  description: Key（调性），默认 `Any`。
                  default: Any
                  enum:
                    - Any
                    - Cm
                    - C#m
                    - Dm
                    - D#m
                    - Em
                    - Fm
                    - F#m
                    - Gm
                    - G#m
                    - Am
                    - A#m
                    - Bm
                    - C
                    - C#
                    - D
                    - D#
                    - E
                    - F
                    - F#
                    - G
                    - G#
                    - A
                    - A#
                    - B
                  examples:
                    - Any
                grabLyrics:
                  type: boolean
                  description: 是否抓取歌词字幕。任务完成后可调用接口获取歌词字幕。
                  examples:
                    - false
                callBackUrl:
                  type: string
                  format: uri
                  description: 回调地址，用于异步接收任务完成通知。
                  examples:
                    - https://api.example.com/callback
              x-apidog-orders:
                - prompt
                - model
                - soundLoop
                - soundTempo
                - soundKey
                - grabLyrics
                - callBackUrl
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      code:
                        type: integer
                        description: |-
                          # 状态码说明

                          - ✅ 200 - 请求成功
                          - ⚠️ 400 - 参数错误
                          - ⚠️ 401 - 没有访问权限
                          - ⚠️ 404 - 请求方式或者路径错误
                          - ⚠️ 405 - 调用超过限制
                          - ⚠️ 413 - 主题或者prompt过长
                          - ⚠️ 429 - 积分不足
                          - ⚠️ 430 - 您的调用频率过高。请稍后再试。
                          - ⚠️ 455 - 网站维护
                          - ❌ 500 - 服务器异常
                        enum:
                          - 200
                          - 400
                          - 401
                          - 404
                          - 405
                          - 413
                          - 429
                          - 430
                          - 455
                          - 500
                        examples:
                          - 200
                      msg:
                        type: string
                        description: 当 code != 200 时，展示错误信息
                        examples:
                          - success
                    x-apidog-orders:
                      - code
                      - msg
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          taskId:
                            type: string
                            description: 任务 ID，用于查询音效生成状态
                            examples:
                              - a1b2****c3d4
                        x-apidog-orders:
                          - taskId
                    x-apidog-orders:
                      - data
          headers: {}
          x-apidog-name: 成功
        '500':
          description: 服务器异常
          headers: {}
          x-apidog-name: 服务器错误
      security: []
      x-apidog-folder: docs/zh-CN/Suno API/Generate Sounds
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1412907/apis/api-46842385-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: []

```
