Extend
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.
Endpoint
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
audio_file | UploadFile | Optional | Upload the audio file to extend. Required if audio_url is not provided. |
audio_url | String | Optional | Public or S3 URL to the input audio. Required if audio_file is not provided. |
extend_after | Float | Required | Time (in seconds) after which new audio is generated. |
prompt | String | Optional | Describes the desired extension sound. Example: “Add a melodic flute section” |
lyrics | String | Optional | Original lyrics of song. Max 2000 characters. |
lyrics_section_to_extend | String | Optional | Optional lyrics for the extended segment. Max 3000 characters. |
gender | String | Optional | Voice style if vocals are generated. Must be one of male, female, neutral. |
num_outputs | int | Optional | The number of outputs to generate (1 or 2 only, default : 2). |
webhook_url | String | Optional | Callback URL for async result delivery. |
💡 Note: You must provide eitheraudio_fileoraudio_url— at least one is required.
content-type: multipart/form-data
Sample Output
Listen to the extended audio. Prompt: loud drums sound - audio input : Rose and Bruno Mars - APT extend after: 6 Download AudioTry it Yourself
Visit the Extend Endpoint Explorer to play around — set your payload, hit send, and listen to the generated results live.Sample Request
cURL
Python
🔐 Replace{path_to_your_audio_file},api_key, andwebhook_urlbefore executing.
Sample Response
Success (200 OK)
Webhook Response
When the extension process completes, the webhook receives:Webhook Delivery
Once the generation is complete, webhooks will be triggered to deliver the following:Standard Requests (non-instrumental):
- 2 (webhooks) x Extend conversion details (one per version)
- 2 (webhooks) x Lyrics with timestamp data
- 1 Album Cover Image
Webhook responses include detailed metadata including task_id, conversion_id, audio files (conversion_path), lyrics etc.
Common Errors
- 422 Unprocessable Entity: Missing required fields like
extend_after, or neitheraudio_filenoraudio_urlprovided. - 500 Internal Server Error: An unexpected error occurred during processing.
The response provides a downloadable or streamable extended audio file.
Authorizations
Body
- Option 1
- Option 2
URL or S3 path to the input audio.
"https://mybucket.s3.amazonaws.com/song.mp3"
Time in seconds after which to start the extension.
35
Uploaded audio file to be extended.
Describes how the extended section should sound.
"Add a calming piano outro"
Original lyrics of song
2000"Let the journey fade away"
Lyrics to be used for the extended portion(optional, max 3000 characters).
3000Voice style if vocal content is generated.
male, female, neutral "neutral"
The number of outputs to generate (1 or 2 only):default is 2.
Callback URL for async processing results.
"https://example.com/webhook"