Vocal separation

Submit a separation task

Use an Anycap connection key authorized for vocal separation. Replace input_url with an HTTPS audio or video download URL accessible without signing in. Pricing is CNY 0.066 per minute of input, rounded up to seconds with a 60-second minimum. The total rounds up to a whole credit. Choose wav, mp3 or aac. Reuse the idempotency key for retries of the same request and change it for a new task.

BASH
curl -sS -X POST 'https://api.anycap.io/v1/vocal-separation/jobs' \  -H 'Authorization: Bearer YOUR_ANYCAP_API_KEY' \  -H 'Content-Type: application/json' \  -H 'Idempotency-Key: vocal-test-001' \  -d '{"input_url":"https://example.com/input.mp3","output_format":"mp3","confirm_processing":true}'

Check the task

Replace JOB_ID with the top-level id from the HTTP 202 response. Query with the same connection. For submitting or processing, check again after 15 seconds. pending means the submission outcome is unknown. Read error_code and error_message for failed or pending tasks. When completed, save result.vocals_url, result.background_url and any result.vocals_video_url promptly. Temporary links are shown for up to 23 hours after completion.

BASH
curl -sS 'https://api.anycap.io/v1/vocal-separation/jobs/JOB_ID' \  -H 'Authorization: Bearer YOUR_ANYCAP_API_KEY'

Download vocals and background audio

Replace VOCALS_URL and BACKGROUND_URL with the complete URLs from the task result. Adjust the file extensions if you chose a format other than MP3.

BASH
curl -fL 'VOCALS_URL' -o vocals.mp3
BASH
curl -fL 'BACKGROUND_URL' -o background.mp3