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

# Sing Over Instrumental

> This endpoint allows users to sing over an instrumental audio track using a text prompt and lyrics. It supports either a file upload or a URL to the input audio and generates a vocal overlay based on the provided lyrics and style.



## OpenAPI

````yaml POST /v1/sing_over_instrumental
openapi: 3.1.0
info:
  title: Musicgpt API
  version: 1.0.0
  description: API for retrieving conversion details by ID.
servers:
  - url: https://api.musicgpt.com/api/public
    description: Production server
security: []
paths:
  /v1/sing_over_instrumental:
    post:
      summary: Sing Over Instrumental Using Prompt and Lyrics
      description: >-
        This endpoint allows users to sing over an instrumental audio track
        using a text prompt and lyrics. It supports either a file upload or a
        URL to the input audio and generates a vocal overlay based on the
        provided lyrics and style.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                audio_file:
                  type: string
                  format: binary
                  description: Uploaded instrumental audio file.
                audio_url:
                  type: string
                  description: URL or S3 path to the input instrumental audio.
                  example: https://bucket.s3.amazonaws.com/audio.mp3
                prompt:
                  type: string
                  description: Description of the singing style, tone, or genre.
                  example: Sing emotional vocals over a soft piano instrumental.
                lyrics:
                  type: string
                  description: The lyrics to be sung over the instrumental.
                  example: Never mind I'll find someone like you...
                  maxLength: 2000
                gender:
                  type: string
                  description: Voice gender to guide generation.
                  enum:
                    - male
                    - female
                    - neutral
                  example: female
                webhook_url:
                  type: string
                  description: >-
                    Callback URL to receive status updates or final audio
                    result.
                  example: https://yourdomain.com/webhook
              required:
                - prompt
                - lyrics
              anyOf:
                - required:
                    - audio_url
                - required:
                    - audio_file
      responses:
        '200':
          description: Successfully initiated sing over instrumental task
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  task_id:
                    type: string
                  conversion_id_1:
                    type: string
                  conversion_id_2:
                    type: string
                  eta:
                    type: integer
                    description: Estimated processing time in seconds
                  credit_estimate:
                    type: number
                    format: float
                example:
                  success: true
                  message: Sing Over Instrumental request submitted successfully
                  task_id: task-abcde12345
                  conversion_id_1: over-instrumental-1
                  conversion_id_2: over-instrumental-2
                  eta: 45
                  credit_estimate: 50
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: >-
                      Either audio_file or audio_url must be provided, along
                      with prompt and lyrics.
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Internal Server Error
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Python
          source: >-
            import requests


            url =
            "https://api.musicgpt.com/api/public/v1/sing_over_instrumental"

            headers = {"Authorization": "<API_KEY>"}

            data = {
              "prompt": "Sing emotional vocals over a soft piano instrumental.",
              "lyrics": "Never mind I'll find someone like you...",
              "gender": "female",
              "webhook_url": "https://yourdomain.com/webhook"
            }


            # Option 1: Use audio_url

            data["audio_url"] = "https://bucket.s3.amazonaws.com/audio.mp3"

            response = requests.post(url, headers=headers, data=data)


            # Option 2: Upload file

            # with open("audio.mp3", "rb") as f:

            #     files = {"audio_file": f}

            #     response = requests.post(url, headers=headers, data=data,
            files=files)


            # print(response.json())
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````