---
title: "Extend Audio Using Prompt and Optional Lyrics"
method: POST
path: "/v1/extend"
---

# Extend Audio Using Prompt and Optional Lyrics

`POST /v1/extend`

## Request

- Base URL: `https://api.musicgpt.com/api/public`
- URL: `https://api.musicgpt.com/api/public/v1/extend`
- Auth: API key in header `Authorization`

This endpoint allows users to extend an existing audio file or stream by appending new audio content after a specific timestamp. The new audio is generated using a prompt (e.g., describing the desired sound) and optional lyrics.

## Request body `multipart/form-data`

- union
  - object
    - `audio_file` string, binary: Uploaded audio file to be extended.
    - `audio_url` string, required: Input audio URL (supported format: YouTube URL).
    - `extend_after` number, float, required: Time in seconds after which to start the extension.
    - `prompt` string: Describes how the extended section should sound.
    - `lyrics` string: Original lyrics of song
    - `lyrics_section_to_extend` string: Lyrics to be used for the extended portion(optional, max 3000 characters).
    - `gender` 'male' | 'female' | 'neutral': Voice style if vocal content is generated.
    - `title` string: Title of the generated music track
    - `num_outputs` number: The number of outputs to generate (1 or 2 only):default is 2.
    - `generate_album_cover` boolean: Whether to generate an album cover for the generated audio
    - `webhook_url` string: Callback URL for async processing results.
  - object
    - `audio_file` string, binary, required: Uploaded audio file to be extended.
    - `audio_url` string: Input audio URL (supported format: YouTube URL).
    - `extend_after` number, float, required: Time in seconds after which to start the extension.
    - `prompt` string: Describes how the extended section should sound.
    - `lyrics` string: Original lyrics of song
    - `lyrics_section_to_extend` string: Lyrics to be used for the extended portion(optional, max 3000 characters).
    - `gender` 'male' | 'female' | 'neutral': Voice style if vocal content is generated.
    - `title` string: Title of the generated music track
    - `num_outputs` number: The number of outputs to generate (1 or 2 only):default is 2.
    - `generate_album_cover` boolean: Whether to generate an album cover for the generated audio
    - `webhook_url` string: Callback URL for async processing results.

## Response `200`

Successfully initiated extend task

- object
  - `success` boolean
  - `message` string
  - `task_id` string
  - `conversion_id_1` string
  - `conversion_id_2` string
  - `eta` integer: Estimated processing time in seconds
  - `credit_estimate` number, float

## Other responses

- `422`: Validation Error
- `500`: Server Error

---

[API](https://skmtc.dev/musicgpt/apis/musicgpt-api.md) - [All operations](https://skmtc.dev/musicgpt/apis/musicgpt-api/llms.txt) - [OpenAPI document](https://skmtc.dev/musicgpt/apis/musicgpt-api/revisions/6753dccf4c5d?raw)
