elevenlabs Music Generation API

Endpoints for generating music from text prompts using AI models.

Documentation

Specifications

Other Resources

OpenAPI Specification

elevenlabs-music-generation-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: ElevenLabs Audio Isolation Agents Music Generation API
  description: The ElevenLabs Audio Isolation API removes background noise from audio recordings, isolating vocal tracks from ambient sounds and interference. This is useful for cleaning up recordings, improving audio quality for podcasts and interviews, and preparing audio files for further processing such as voice cloning or transcription.
  version: '1.0'
  contact:
    name: ElevenLabs Support
    url: https://help.elevenlabs.io
  termsOfService: https://elevenlabs.io/terms-of-service
servers:
- url: https://api.elevenlabs.io
  description: Production Server
security:
- apiKeyAuth: []
tags:
- name: Music Generation
  description: Endpoints for generating music from text prompts using AI models.
paths:
  /v1/music:
    post:
      operationId: createMusic
      summary: Create music
      description: Generates an original musical composition from a text prompt describing the desired genre, mood, tempo, instrumentation, and other characteristics. Returns generated audio in the specified format.
      tags:
      - Music Generation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MusicGenerationRequest'
      responses:
        '200':
          description: Music generated successfully
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - invalid or missing API key
        '422':
          description: Unprocessable entity - validation error
components:
  schemas:
    MusicGenerationRequest:
      type: object
      required:
      - prompt
      properties:
        prompt:
          type: string
          description: A natural language description of the music to generate. Include details about genre, mood, tempo, instrumentation, and any other desired characteristics.
          maxLength: 1000
        duration_seconds:
          type: number
          description: The desired duration of the generated music in seconds.
          minimum: 1
        loop:
          type: boolean
          description: Whether the generated music should be designed to loop seamlessly.
          default: false
        instrumental:
          type: boolean
          description: Whether to generate instrumental-only music without vocals or lyrics.
          default: false
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: xi-api-key
      description: ElevenLabs API key passed in the xi-api-key header for authentication.
externalDocs:
  description: ElevenLabs Audio Isolation API Documentation
  url: https://elevenlabs.io/docs/api-reference/audio-isolation/audio-isolation