If your media is local rather than a public URL, upload it first to create an Asset. Then reference the returned assetId when creating a Task.
Upload and create a Task
import requests
API_KEY = "your_api_key"
# 1. Upload the file
upload_res = requests.post(
"https://api.audioshake.ai/assets",
headers={"x-api-key": API_KEY},
files={"file": open("song.mp3", "rb")}
)
asset_id = upload_res.json()["id"]
print(f"Asset created: {asset_id}")
# 2. Create a Task using the assetId
task_res = requests.post(
"https://api.audioshake.ai/tasks",
headers={"Content-Type": "application/json", "x-api-key": API_KEY},
json={
"assetId": asset_id,
"targets": [
{"model": "vocals", "formats": ["wav"]},
{"model": "instrumental", "formats": ["wav"]}
]
}
)
task_id = task_res.json()["id"]
print(f"Task created: {task_id}")
Then check Task status to monitor progress and download results.
Maximum file size is 2GB. Uploaded Assets expire after 72 hours.
See the Formats page for supported input file types.