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

# ElevenLabs Music v2.5

> Generate music from exactly one of prompt and composition_plan, using integer milliseconds. Auto output resolves to MP3; optional C2PA signing is MP3-only.

Submit asynchronously and [query the task](/pages/en/api-manual/task-management/get-task-detail). Download results[0].url on completion. Only returned metadata is preserved; save audio promptly.

Provide exactly one of `prompt` and `composition_plan`. Prompt accepts up to4100 characters. In prompt mode, `music_length_ms` is an integer from3000 to600000ms; omit it to let the model choose. `force_instrumental` defaults to false and is only valid in prompt mode.

A plan has1–30 ordered `chunks`, totaling3000–600000ms. Each requires text (may be empty), duration\_ms (3000–120000) and positive\_styles. Negative styles and context\_adherence are optional. Lyrics allow at most30 lines of200 characters per chunk. Seed is only valid with a plan and does not guarantee reproducibility.

`output_format` defaults to auto, resolving to mp3\_48000\_192. `sign_with_c2pa` defaults to false and requires MP3 (including auto); it never silently changes your format. Audio references, explicit timestamps (including false), and safety controls retain their full meaning; unavailable combinations fail explicitly.

Actual complete output duration is rounded up to whole minutes at **\$0.6/minute**. Both3 seconds and60 seconds count as1 minute; over60 seconds counts as2. Requested duration estimates the reservation; decoded output duration, saved prices and group multipliers determine final settlement.

[Query the task](https://docs.aihubmax.com/pages/en/api-manual/task-management/get-task-detail.md) and download results\[0].url. Composition plans, song metadata and word timestamps are retained only when returned; ordinary audio may have no detailed metadata. Decode raw formats using returned sample rate, channels and Content-Type, and save audio promptly.


## OpenAPI

````yaml openapi/en/elevenlabs-music-v2.5.json POST /v1/audios/generations
openapi: 3.1.0
info:
  title: ElevenLabs Music v2.5
  version: '1.0'
servers:
  - url: https://api.aihubmax.com/e
security:
  - BearerAuth: []
paths:
  /v1/audios/generations:
    post:
      tags:
        - Audio > Music
      summary: ElevenLabs Music v2.5
      description: >-
        Generate music from exactly one of prompt and composition_plan, using
        integer milliseconds. Auto output resolves to MP3; optional C2PA signing
        is MP3-only.


        Submit asynchronously and [query the
        task](/pages/en/api-manual/task-management/get-task-detail). Download
        results[0].url on completion. Only returned metadata is preserved; save
        audio promptly.
      operationId: elevenlabs-music-v2.5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElevenLabsMusicV25Request'
            examples:
              prompt_instrumental_background_music:
                summary: Example request
                value:
                  model: elevenlabs-music-v2.5
                  prompt: >-
                    Gentle piano and warm strings for a quiet evening, no
                    vocals.
                  music_length_ms: 30000
                  force_instrumental: true
              composition_plan_a_song_with_two_sections:
                summary: Example request
                value:
                  model: elevenlabs-music-v2.5
                  seed: 42
                  composition_plan:
                    chunks:
                      - text: |-
                          [Verse 1]
                          Neon rain on empty streets
                        duration_ms: 15000
                        positive_styles:
                          - synthwave
                          - female vocal
                      - text: |-
                          [Chorus]
                          We keep dancing through the night
                        duration_ms: 15000
                        positive_styles:
                          - uplifting synthwave
                        context_adherence: high
              composition_plan_audio_style_reference:
                summary: Example request
                value:
                  model: elevenlabs-music-v2.5
                  composition_plan:
                    chunks:
                      - text: '[Instrumental]'
                        duration_ms: 15000
                        positive_styles:
                          - cinematic
                          - woodwinds
                        audio_reference:
                          audio_url: >-
                            https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/music_generated.mp3
                          start_ms: 0
                          end_ms: 15000
                          strength: medium
                  output_format: mp3_48000_192
      responses:
        '200':
          $ref: '#/components/responses/TaskCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    ElevenLabsMusicV25Request:
      type: object
      required:
        - model
      properties:
        model:
          description: >-
            elevenlabs-music-v2.5: prompt or composition plan, 3–600 seconds.
            Actual complete output duration rounds up to whole minutes at
            $0.6/minute.
          examples:
            - elevenlabs-music-v2.5
          type: string
          default: elevenlabs-music-v2.5
        prompt:
          anyOf:
            - maxLength: 4100
              minLength: 1
              type: string
            - type: 'null'
          default: null
          description: >-
            Music description, 1–4100 characters. Provide exactly one of prompt
            and composition_plan.
          example: Mysterious jungle soundtrack with woodwinds and rhythmic percussion.
        composition_plan:
          anyOf:
            - additionalProperties: false
              properties:
                chunks:
                  description: 1–30 ordered chunks, totaling 3000–600000 milliseconds.
                  items:
                    additionalProperties: false
                    properties:
                      text:
                        description: >-
                          Lyrics or performance directions for this chunk. May
                          begin with a section name such as [Verse 1], 1–100
                          characters, and contain inline directions such as
                          {scratching}. At most 30 lines and 200 characters per
                          line; may be empty for instrumental music.
                        type: string
                        example: |-
                          [Verse 1]
                          Neon rain on empty streets
                          I keep walking to the beat
                      duration_ms:
                        description: Chunk duration in integer milliseconds, 3000–120000.
                        maximum: 120000
                        minimum: 3000
                        type: integer
                        example: 15000
                      positive_styles:
                        description: >-
                          Desired styles, preferably in English. The first chunk
                          establishes the main style.
                        items:
                          type: string
                        type: array
                        example:
                          - synthwave
                          - analog drum machine
                      negative_styles:
                        anyOf:
                          - items:
                              type: string
                            type: array
                          - type: 'null'
                        default: null
                        description: Styles to avoid. Omit or leave empty when not needed.
                        example:
                          - distortion
                      context_adherence:
                        anyOf:
                          - enum:
                              - low
                              - medium
                              - high
                            type: string
                          - type: 'null'
                        default: null
                        description: >-
                          Consistency with adjacent chunks: low allows more
                          freedom; high favors continuity.
                        example: medium
                      audio_reference:
                        anyOf:
                          - additionalProperties: false
                            properties:
                              audio_url:
                                description: >-
                                  Publicly downloadable HTTP/HTTPS reference
                                  audio URL.
                                type: string
                                example: >-
                                  https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/music_generated.mp3
                              start_ms:
                                default: 0
                                description: >-
                                  Reference start offset in integer
                                  milliseconds.
                                minimum: 0
                                type: integer
                                example: 0
                              end_ms:
                                anyOf:
                                  - exclusiveMinimum: 0
                                    type: integer
                                  - type: 'null'
                                default: null
                                description: >-
                                  Optional end offset, greater than start_ms;
                                  window at most 30000ms. Omit to use 30 seconds
                                  or the end of the audio, whichever comes
                                  first.
                                example: 15000
                              strength:
                                anyOf:
                                  - enum:
                                      - low
                                      - medium
                                      - high
                                      - xhigh
                                    type: string
                                  - type: 'null'
                                default: null
                                description: >-
                                  Reference strength: low, medium, high or
                                  xhigh.
                                example: medium
                            required:
                              - audio_url
                            type: object
                          - type: 'null'
                        default: null
                        description: >-
                          Optional audio reference. The first chunk reference
                          affects later chunks. Requires the complete
                          capability; unavailable combinations fail explicitly.
                        example:
                          audio_url: >-
                            https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/music_generated.mp3
                          end_ms: 15000
                          start_ms: 0
                    required:
                      - text
                      - duration_ms
                      - positive_styles
                    type: object
                  maxItems: 30
                  minItems: 1
                  type: array
                  example:
                    - duration_ms: 15000
                      positive_styles:
                        - ambient
                      text: '[Intro]'
              required:
                - chunks
              type: object
            - type: 'null'
          default: null
          description: >-
            Ordered composition plan, mutually exclusive with prompt. Each chunk
            can specify lyrics and styles. Explicit references require full
            support.
          example:
            chunks:
              - duration_ms: 15000
                positive_styles:
                  - ambient
                text: '[Intro]'
        music_length_ms:
          anyOf:
            - maximum: 600000
              minimum: 3000
              type: integer
            - type: 'null'
          default: null
          description: >-
            Integer duration in milliseconds, 3000–600000, prompt mode only.
            Omit to let the model choose. Final billing uses actual complete
            output duration rounded up to minutes.
          example: 30000
        force_instrumental:
          default: false
          description: >-
            Prompt mode only. True guarantees instrumental music; false lets the
            prompt determine vocals.
          type: boolean
          example: true
        seed:
          anyOf:
            - maximum: 2147483647
              minimum: 0
              type: integer
            - type: 'null'
          default: null
          description: >-
            Optional random seed, composition_plan mode only. Zero is valid.
            Reproducibility is not guaranteed.
          example: 42
        output_format:
          default: auto
          description: >-
            Output format. Auto resolves to mp3_48000_192. Signing never changes
            the specified format.
          enum:
            - auto
            - mp3_22050_32
            - mp3_44100_32
            - mp3_44100_64
            - mp3_44100_96
            - mp3_44100_128
            - mp3_44100_192
            - pcm_8000
            - pcm_16000
            - pcm_22050
            - pcm_24000
            - pcm_44100
            - pcm_48000
            - ulaw_8000
            - alaw_8000
            - opus_48000_32
            - opus_48000_64
            - opus_48000_96
            - opus_48000_128
            - opus_48000_192
            - mp3_24000_48
            - mp3_48000_128
            - mp3_48000_192
            - mp3_48000_240
            - mp3_48000_320
            - pcm_32000
          type: string
          example: mp3_48000_192
        enable_safety_checker:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: >-
            Explicit safety control; false is not ignored. Unsupported requests
            fail explicitly.
          example: true
        timestamps:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: >-
            Request timestamps only when the complete capability is available.
            Unsupported requests fail explicitly. For Music, explicit false
            still requests the detailed-result behavior; omit/null to leave it
            unspecified.


            > Advanced option: omit unless needed.
          x-advanced: true
          example: true
        sign_with_c2pa:
          default: false
          description: >-
            Add a content provenance signature. MP3 only, including auto.
            Defaults to false; never changes a specified format.
          type: boolean
          example: false
      additionalProperties: false
    TaskResponse:
      type: object
      properties:
        created:
          type: integer
          description: Task creation timestamp
          example: 1757165031
        id:
          type: string
          description: Task ID
          example: task-unified-1757165031-uyujaw3d
        model:
          type: string
          description: >-
            elevenlabs-music-v2.5: prompt or composition plan, 3–600 seconds.
            Actual complete output duration rounds up to whole minutes at
            $0.6/minute.
        object:
          type: string
          description: Task type
          enum:
            - audio.generation.task
        progress:
          type: integer
          description: Task progress (0–100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: Task status
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          type: object
          description: Asynchronous task information
          properties:
            can_cancel:
              type: boolean
              description: Whether the task can be canceled
              example: true
            estimated_time:
              type: integer
              description: Estimated completion time in seconds
              example: 45
        type:
          type: string
          description: Output type
          enum:
            - audio
          example: audio
    ErrorResponse400:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 请求格式错误
            type:
              type: string
              example: invalid_request_error
    ErrorResponse401:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: API密钥无效
            type:
              type: string
              example: authentication_error
    ErrorResponse402:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 账户余额不足
            type:
              type: string
              example: insufficient_quota
    ErrorResponse422:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 参数校验失败
            type:
              type: string
              example: validation_error
    ErrorResponse429:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 请求频率超限
            type:
              type: string
              example: rate_limit_error
    ErrorResponse500:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 服务器内部错误
            type:
              type: string
              example: server_error
    ErrorResponse503:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 服务暂不可用，请稍后重试
            type:
              type: string
              example: service_unavailable
  responses:
    TaskCreated:
      description: Task created
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TaskResponse'
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse400'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse401'
    PaymentRequired:
      description: Insufficient balance
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse402'
    UnprocessableEntity:
      description: Validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse422'
    TooManyRequests:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse429'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse500'
    ServiceUnavailable:
      description: Service unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse503'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        All endpoints require Bearer authentication.

        Add this request header:

        `Authorization: Bearer YOUR_API_KEY`

````

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