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

# 上传音频

> 上传音频文件进行处理

通过 URL 上传音频文件。上传的音频可用于音轨分离和其他操作。

<Info>
  这是一个异步任务。响应中包含一个 `taskId` — 使用[获取任务状态](/zh/api-reference/producer/task)来轮询结果，结果中包含后续操作所需的 `audioId`。
</Info>

**支持的格式**：MP3、WAV、FLAC、M4A、AAC、OGG、WMA、OPUS

**时长限制**：最长 4 分钟

<Tip>
  `audioUrl` 必须是可公开访问的 URL。任务结果中会包含自动转录的歌词（如可用）。
</Tip>


## OpenAPI

````yaml POST /producer/upload
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/upload:
    post:
      tags:
        - producer
      summary: 上传音频
      description: 上传音频文件（支持 URL）。返回 taskId，使用 /producer/tasks 接口轮询获取结果
      operationId: ApiPublicController_uploadAudio
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadAudioDto'
      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:
    UploadAudioDto:
      type: object
      properties:
        audioUrl:
          type: string
          pattern: AUDIO_EXTENSION_REGEX
          description: |-
            Audio file URL (http/https supported).
                Supported formats: .mp3, .wav, .flac, .m4a, .aac, .ogg, .wma, .opus
                Duration limit: max 4 minutes
          example: https://example.com/song.mp3
      required:
        - audioUrl
    TaskIdDto:
      type: object
      properties:
        taskId:
          type: string
          description: 任务 ID，用于后续查询结果
      required:
        - taskId
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````