> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poyo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 生成音效

> 生成音效 API 使用 Suno V5 或 V5.5，根据文本提示词生成音效、环境声或音乐采样。速度、调式和可循环结果均为可选项。

`mv` 使用 `V5`、`V5_5`、`V6`、`V6_MINI` 或 `V6_WILD`。`sound_tempo` 为 1–300 BPM 的整数；`sound_key` 接受大调/小调，例如 `C`、`F#`、`Am` 或 `C#m`。设置 `sound_loop` 可获得可循环的结果；提示词包含人声素材时设置 `grab_lyrics`。

```json theme={"dark"}
{"model":"generate-sounds","input":{"prompt":"Rain on a metal roof with distant thunder","mv":"V5_5","sound_loop":true,"sound_tempo":90,"sound_key":"Cm","grab_lyrics":false}}
```


## OpenAPI

````yaml zh/api-manual/music-series/generate-sounds.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: PoYo 生成音效 API
  version: 1.0.0
  description: 根据文本提示词生成音效和环境声。
servers:
  - url: https://api.poyo.ai
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      summary: 生成音效
      operationId: submitGenerateSounds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Request'
            example:
              model: generate-sounds
              input:
                prompt: Rain and distant thunder
                mv: V5_5
                sound_loop: true
                sound_tempo: 90
                sound_key: Cm
                grab_lyrics: false
      responses:
        '200':
          description: 已提交
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
components:
  schemas:
    Request:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          enum:
            - generate-sounds
        callback_url:
          type: string
          format: uri
        input:
          type: object
          additionalProperties: false
          required:
            - prompt
            - mv
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 500
            mv:
              type: string
              enum:
                - V5
                - V5_5
                - V6
                - V6_MINI
                - V6_WILD
            sound_loop:
              type: boolean
              default: false
            sound_tempo:
              type: integer
              minimum: 1
              maximum: 300
            sound_key:
              type: string
              enum:
                - 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
            grab_lyrics:
              type: boolean
              default: false
    Response:
      type: object
      properties:
        code:
          type: integer
          example: 200
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
          description: >-
            业务状态码。`200` 表示成功，其他值都表示请求失败。请务必检查这个字段：部分参数校验错误会以 HTTP 200 返回，响应体里的
            `code` 为 `400`。


            - `200`：成功

            - `400`：请求参数无效

            - `401`：API Key 缺失或无效

            - `402`：积分不足

            - `403`：没有权限

            - `404`：资源不存在

            - `408`：请求超时

            - `429`：请求频率超限

            - `500`：服务器内部错误

            - `502`：上游服务错误

            - `503`：服务暂不可用


            详见[错误码](/zh/api-manual/error-codes)。
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
            status:
              type: string
              enum:
                - not_started
                - running
                - finished
                - failed
              description: |-
                任务状态。

                - `not_started`：排队中，等待处理
                - `running`：生成中
                - `finished`：已完成，结果在 `files` 或 `output` 中
                - `failed`：失败，详情见 `error_message`
            created_time:
              type: string
              format: date-time
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        所有 API 接口都需要 Bearer Token 认证。


        创建 API Key：登录 PoYo，进入 **仪表盘 → API
        密钥**（[poyo.ai/zh/dashboard/api-key](https://poyo.ai/zh/dashboard/api-key)），点击创建
        Key。


        在请求头中添加：


        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.