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

# 创作音乐

> 使用 Lyria 3 Pro 生成音乐

使用 Google DeepMind 的 **Lyria 3 Pro** 模型生成音乐。提供音效提示来描述所需风格，和/或提供歌词来创作原创曲目。

<Info>
  这是一个异步任务。响应中包含一个 `taskId` — 使用[获取任务状态](/zh/api-reference/producer/task)来轮询生成的音频。
</Info>

## 提示

* **音效提示**：描述音乐风格、氛围、乐器和节奏（例如 `"emotional pop with gentle piano, warm synths, and a catchy beat"`）
* **歌词**：使用段落标签如 `[Verse]`、`[Chorus]`、`[Bridge]` 来获得结构化输出
* **图片引导**：提供 `imageUrl` 让模型从图片中推断氛围和风格
* **纯器乐**：设置 `makeInstrumental: true` 生成无人声曲目
* **可重复性**：使用 `seed` 进行确定性生成 — 相同的 seed + 相同的参数 = 相同的输出


## OpenAPI

````yaml POST /producer/audios
openapi: 3.0.0
info:
  title: Producer - AI Music Generation
  description: >-
    Generate music with Google DeepMind's Lyria 3 Pro model. Supports
    text-to-music, lyrics-to-music, and image-guided generation with stem
    separation and multi-format export.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.mountsea.ai
    description: API Gateway
security: []
tags:
  - name: producer
    description: >-
      Music generation, audio upload, stem separation, and export endpoints
      powered by Lyria 3 Pro
paths:
  /producer/audios:
    post:
      tags:
        - producer
      summary: 音频生成
      description: |-
        音频生成接口（action: create_music）。
        返回 taskId，使用 /producer/tasks 接口轮询获取结果
      operationId: ApiPublicController_createAudio
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudioRequestDto'
      responses:
        '200':
          description: 任务创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskIdDto'
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskIdDto'
      security:
        - bearerAuth: []
components:
  schemas:
    AudioRequestDto:
      type: object
      properties:
        action:
          type: string
          enum:
            - create_music
          description: Action type to perform
          example: create_music
        soundPrompt:
          type: string
          description: Sound/style prompt describing the desired music style
          example: driving energetic beat, rapid rhythm, high BPM
        lyrics:
          type: string
          description: |-
            Lyrics content with section tags like [Verse], [Chorus], etc.
                For create_music: either soundPrompt or lyrics should be provided.
                Set makeInstrumental=true to ignore lyrics.
          example: |-
            [Verse 1]
            I've been running in circles...

            [Chorus]
            I keep coming back to you...
        title:
          type: string
          maxLength: 80
          description: Song title (max 80 characters)
          example: Back to You
        model:
          type: string
          enum:
            - Lyria 3 Pro
          description: Music generation model (currently only Lyria 3 Pro)
          example: Lyria 3 Pro
        seed:
          type: number
          description: Random seed for reproducible generation
          example: 877369
        makeInstrumental:
          type: boolean
          description: 'Generate instrumental only (ignores lyrics). Default: false'
          example: false
        imageUrl:
          type: string
          description: >-
            Image URL for image-guided generation (will be uploaded
            automatically)
          example: https://example.com/cover.jpg
      required:
        - action
    TaskIdDto:
      type: object
      properties:
        taskId:
          type: string
          description: 任务 ID，用于后续查询结果
      required:
        - taskId
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````