Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Upload a local file and use it in a Task
assetId
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}")
const API_KEY = "your_api_key"; // 1. Upload the file const formData = new FormData(); formData.append("file", fileBlob, "song.mp3"); const uploadRes = await fetch("https://api.audioshake.ai/assets", { method: "POST", headers: { "x-api-key": API_KEY }, body: formData }); const { id: assetId } = await uploadRes.json(); console.log(`Asset created: ${assetId}`); // 2. Create a Task using the assetId const taskRes = await fetch("https://api.audioshake.ai/tasks", { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": API_KEY }, body: JSON.stringify({ assetId, targets: [ { model: "vocals", formats: ["wav"] }, { model: "instrumental", formats: ["wav"] } ] }) }); const { id: taskId } = await taskRes.json(); console.log(`Task created: ${taskId}`);
# 1. Upload the file curl -X POST "https://api.audioshake.ai/assets" \ -H "x-api-key: $AUDIOSHAKE_API_KEY" \ -F 'file=@song.mp3' # 2. Create a Task with the returned assetId curl -X POST "https://api.audioshake.ai/tasks" \ -H "Content-Type: application/json" \ -H "x-api-key: $AUDIOSHAKE_API_KEY" \ -d '{ "assetId": "your_asset_id", "targets": [ { "model": "vocals", "formats": ["wav"] }, { "model": "instrumental", "formats": ["wav"] } ] }'
Was this page helpful?