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

# 视频配乐

> 根据视频内容生成背景音乐

根据视频内容自动生成匹配的背景音乐。AI 会分析视频画面，创建与情绪、节奏和转场相匹配的音乐。

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

## 限制

* 每次请求最多 **10** 个视频 URL
* 总文件大小：最大 **200 MB**
* 总视频时长：最大 **600 秒**（10 分钟）

<Tip>
  添加 `description` 和 `tags` 来引导 AI 生成所需风格。例如 `"description": "Upbeat background music for a travel vlog"`，`"tags": ["upbeat", "cinematic"]`。
</Tip>


## OpenAPI

````yaml POST /eleven/video-to-music
openapi: 3.0.0
info:
  title: Eleven AI
  description: API documentation for Eleven AI
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.mountsea.ai
    description: API Gateway
security: []
tags:
  - name: eleven
    description: ''
paths:
  /eleven/video-to-music:
    post:
      tags:
        - eleven
      summary: 视频配乐
      description: |-
        对应 ElevenLabs POST /v1/music/video-to-music。
        根据视频内容生成背景音乐。返回 taskId，使用 GET /eleven/tasks 轮询获取结果
      operationId: ApiPublicController_videoToMusic
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoToMusicDto'
      responses:
        '200':
          description: 任务创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskIdDto'
      security:
        - bearerAuth: []
components:
  schemas:
    VideoToMusicDto:
      type: object
      properties:
        videoUrls:
          maxItems: 10
          description: 视频文件 URL 列表（最多 10 个，总大小限 200MB，总时长限 600 秒）
          example:
            - https://example.com/video.mp4
          type: array
          items:
            type: string
        description:
          type: string
          maxLength: 1000
          description: 音乐描述（最多 1000 字符）
          example: Upbeat background music for a travel vlog
        tags:
          maxItems: 10
          description: 风格标签（最多 10 个）
          example:
            - upbeat
            - cinematic
          type: array
          items:
            type: string
        outputFormat:
          enum:
            - mp3_22050_32
            - mp3_24000_48
            - mp3_44100_32
            - mp3_44100_64
            - mp3_44100_96
            - mp3_44100_128
            - mp3_44100_192
            - pcm_8000
            - pcm_16000
            - pcm_22050
            - pcm_24000
            - pcm_32000
            - pcm_44100
            - pcm_48000
            - ulaw_8000
            - alaw_8000
            - opus_48000_32
            - opus_48000_64
            - opus_48000_96
            - opus_48000_128
            - opus_48000_192
          type: string
          description: 输出格式，格式为 codec_sampleRate_bitrate
          default: mp3_44100_128
        signWithC2pa:
          type: boolean
          description: 是否使用 C2PA 签名标记 AI 生成内容。仅适用于 MP3 输出格式
          default: false
      required:
        - videoUrls
    TaskIdDto:
      type: object
      properties:
        taskId:
          type: string
          description: 任务 ID，用于后续查询结果
      required:
        - taskId
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````