POST
/
Remix
import requests

url = "https://api.example.com/api/public/v1/remix"
headers = {"Authorization": "<API_KEY>", "accept": "application/json"}
data = {
  "mode": "REMIX",
  "prompt": "Generate a soothing ambient soundscape."
}

# Option 1: URL
files = {}
data["audio_path"] = "https://www.youtube.com/watch?v=example123"
response = requests.post(url, headers=headers, data=data, files=files)

# Option 2: File Upload
with open("audio.m4a", "rb") as f:
    files = {"audio_file": f}
    response = requests.post(url, headers=headers, data=data, files=files)

print(response.json())
{
  "success": true,
  "task_id": "stem123",
  "conversion_id": "conv456",
  "eta": -1,
  "credit_estimate": 100.1,
  "message": "Successfully published to queue"
}

Create a remix using an input audio file and a prompt.


🎡 Endpoint

POST /Remix

This endpoint processes an input audio file along with a textual prompt to generate a remix. You can specify a webhook_url to receive a callback when processing completes.


πŸ”’ Request Parameters

ParameterTypeRequiredDescription
audio_fileUploadFileOptionalUpload the audio file directly. Required if audio_path is not provided.
audio_pathStringOptionalA URL to an audio file (S3 or YouTube). Required if audio_file is not provided.
promptStringRequiredThe text prompt guiding the remix generation. Example: β€œGenerate a soothing ambient soundscape.”
lyricsStringOptionalIf provided, lyrics will be used to generate the remix.
modeStringRequiredRemix mode. Must be one of REMIX, INPAINT, OVER_INSTRUMENTAL.
webhook_urlStringOptionalCallback URL for async response. Defaults to empty string if not provided.

πŸ’‘ Note: You must provide either audio_file or audio_path β€” at least one is required.


▢️ Sample Output

Listen to a real sample output:

Prompt: a song about greenery, nature and forest.

Download Audio

πŸ§ͺ Try it Yourself

Visit the MusicAI Endpoint Explorer to play around β€” set your payload, hit send, and listen to the generated results live.

πŸ“€ Sample Request

πŸ‘• cURL

curl -X POST "https://api.musicgpt.com/api/public/v1/Remix" \
-H "accept: application/json" \
-H "Authorization: <api_key>" \
-F "audio_file=@/path/to/your/audio.mp3" \
-F "prompt=Create an upbeat pop remix" \
-F "mode=REMIX" \
-F "webhook_url=http://webhook.musicgpt.com"

🐍 Python

import requests

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

headers = {
    "accept": "application/json",
    "Authorization": "<api_key>"
}

input_audio_file = open("{path_to_your_audio_file}", "rb")

payload = {
    "prompt": "Create an upbeat pop remix",
    "mode": "REMIX",
    "webhook_url": "http://abcd.requestcatcher.com/test"
}

response = requests.post(url=url,
                         headers=headers,
                         data=payload,
                         files={"audio_file": input_audio_file})

print(response.status_code, response.json())

πŸ” Replace {path_to_your_audio_file}, api_key, and webhook_url before executing.


πŸ“₯ Sample Response

βœ… Success (200 OK)

{
  "success":true,
  "message":"Remix request submitted successfully",
  "task_id":"dff33bac-6844-4cda-83b8-75078ed916b1",
  "conversion_id_1":"2104a105-2572-4412-b6fb-f67b0382582a",
  "conversion_id_2":"16f80faa-5e71-4b3d-9291-61776c4eb97f",
  "eta":184,
  "status":"IN_QUEUE",
  "credit_estimate":0.99
}

❌ Common Errors

  • 422 Unprocessable Entity: Missing required fields like prompt, or neither audio_file nor audio_path provided.
  • 500 Internal Server Error: An unexpected error occurred during processing.

πŸ“ž Webhook Response

When the remix process completes, the webhook receives:

{
  "success": true, 
  "conversion_type": "Remix", 
  "task_id": "dff33bac-6844-4cda-83b8-75078ed916b1", 
  "conversion_id": "2104a105-2572-4412-b6fb-f67b0382582a", 
  "conversion_path": "https://lalals.s3.amazonaws.com/conversions/2104a105-2572-4412-b6fb-f67b0382582a.mp3", 
  "conversion_path_wav": "https://lalals.s3.amazonaws.com/conversions/2104a105-2572-4412-b6fb-f67b0382582a.wav", 
  "conversion_duration": 162.44680272108843, 
  "is_flagged": false, 
  "reason": "", 
  "lyrics": "[Verse 1]\nI've been staring at the edge of the water\nLong as I can remember\nNever really knowing why\nI wish I could be the perfect daughter\nbut I come back to the water no matter how hard I try\n[Verse 2]\nevery turn I take every trail I track,\nevery path I make, every road leads back\nto the place I know, where I cannot go,\nwhere I long to be.\n[Chorus]\nSee the line where the sky meets the sea, it calls me\nme and no one knows how far it goes\nif the wind in my sail on the sea stays behind me\none day i'll know\nIf I go there's just no telling how far I'll go\n[Verse 3]\nI know everybody on this island\nseems so happy on this island everything is by design\ni know everybody on this island has a role\non this island so maybe i can roll with mine\ni can lead with pride i can make us strong\ni'll be satisfied if i play along\nbut the voice inside sings a different song\nwhat is wrong with me?\n[Chorus]\nSee the light as it shines on the sea\nIt's blinding\nBut no one knows\nHow deep it goes\nAnd it seems like it's calling out to me\nSo come find me\nAnd let me know\nWhat's beyond that line\nWill I cross that line\n[Outro]\nThe line where the sky on the sea stays behind me\nOne day I will know\nhow far I'll go\nOh!", 
  "lyrics_timestamped": "[{\"index\": 0, \"text\": \"[Verse 1]\", \"start\": 3200, \"end\": 3200}, {\"index\": 1, \"text\": \"I've been staring at the edge of the water\", \"start\": 3200, \"end\": 7040}, {\"index\": 2, \"text\": \"Long as I can remember\", \"start\": 7680, \"end\": 10240}, {\"index\": 3, \"text\": \"Never really knowing why\", \"start\": 10880, \"end\": 12800}, {\"index\": 4, \"text\": \"I wish I could be the perfect daughter\", \"start\": 15360, \"end\": 19840}, {\"index\": 5, \"text\": \"but I come back to the water no matter how hard I try\", \"start\": 19840, \"end\": 24960}, {\"index\": 7, \"text\": \"[Verse 2]\", \"start\": 24960, \"end\": 26880}, {\"index\": 8, \"text\": \"every turn I take every trail I track,\", \"start\": 26880, \"end\": 30080}, {\"index\": 9, \"text\": \"every path I make, every road leads back\", \"start\": 30720, \"end\": 32640}, {\"index\": 10, \"text\": \"to the place I know, where I cannot go,\", \"start\": 33280, \"end\": 35200}, {\"index\": 11, \"text\": \"where I long to be.\", \"start\": 35840, \"end\": 37120}, {\"index\": 13, \"text\": \"[Chorus]\", \"start\": 37760, \"end\": 39040}, {\"index\": 14, \"text\": \"See the line where the sky meets the sea, it calls me\", \"start\": 39040, \"end\": 42880}, {\"index\": 15, \"text\": \"me and no one knows how far it goes\", \"start\": 43520, \"end\": 48000}, {\"index\": 16, \"text\": \"if the wind in my sail on the sea stays behind me\", \"start\": 50560, \"end\": 55040}, {\"index\": 17, \"text\": \"one day i'll know\", \"start\": 55040, \"end\": 56960}, {\"index\": 18, \"text\": \"If I go there's just no telling how far I'll go\", \"start\": 58880, \"end\": 61440}, {\"index\": 20, \"text\": \"[Verse 3]\", \"start\": 62720, \"end\": 62720}, {\"index\": 21, \"text\": \"I know everybody on this island\", \"start\": 62720, \"end\": 65280}, {\"index\": 22, \"text\": \"seems so happy on this island everything is by design\", \"start\": 65920, \"end\": 72960}, {\"index\": 23, \"text\": \"i know everybody on this island has a role\", \"start\": 72960, \"end\": 78080}, {\"index\": 24, \"text\": \"on this island so maybe i can roll with mine\", \"start\": 78720, \"end\": 84480}, {\"index\": 25, \"text\": \"i can lead with pride i can make us strong\", \"start\": 84480, \"end\": 87040}, {\"index\": 26, \"text\": \"i'll be satisfied if i play along\", \"start\": 87680, \"end\": 90240}, {\"index\": 27, \"text\": \"but the voice inside sings a different song\", \"start\": 90240, \"end\": 93440}, {\"index\": 28, \"text\": \"what is wrong with me?\", \"start\": 93440, \"end\": 95360}, {\"index\": 30, \"text\": \"[Chorus]\", \"start\": 95360, \"end\": 98560}, {\"index\": 31, \"text\": \"See the light as it shines on the sea\", \"start\": 98560, \"end\": 101120}, {\"index\": 32, \"text\": \"It's blinding\", \"start\": 101120, \"end\": 102400}, {\"index\": 33, \"text\": \"But no one knows\", \"start\": 103680, \"end\": 104960}, {\"index\": 34, \"text\": \"How deep it goes\", \"start\": 106880, \"end\": 110080}, {\"index\": 35, \"text\": \"And it seems like it's calling out to me\", \"start\": 110080, \"end\": 112640}, {\"index\": 36, \"text\": \"So come find me\", \"start\": 112640, \"end\": 115200}, {\"index\": 37, \"text\": \"And let me know\", \"start\": 115200, \"end\": 117120}, {\"index\": 38, \"text\": \"What's beyond that line\", \"start\": 117120, \"end\": 128639}, {\"index\": 39, \"text\": \"Will I cross that line\", \"start\": 128639, \"end\": 131840}, {\"index\": 41, \"text\": \"[Outro]\", \"start\": 131840, \"end\": 133120}, {\"index\": 42, \"text\": \"The line where the sky on the sea stays behind me\", \"start\": 133120, \"end\": 136960}, {\"index\": 43, \"text\": \"One day I will know\", \"start\": 138240, \"end\": 138880}, {\"index\": 44, \"text\": \"how far I'll go\", \"start\": 138880, \"end\": 142080}, {\"index\": 45, \"text\": \"Oh!\", \"start\": 142720, \"end\": 142720}]", 
  "title": "Boundless"
}

🎧 Note: You will receive two separate webhook responses, each with a unique conversion_id for the two generated versions.

The response provides a downloadable or streamable remix audio file.

Authorizations

Authorization
string
header
required

Body

multipart/form-data

Response

200
application/json

Successfully initiated remix task

The response is of type object.