Cloud Music API
Separate a song into individual tracks and a backing track, or generate two original takes with vocals or as instrumentals.
Download OpenAPI specificationRequests
Use https://api.soniqo.audio/v1/music as the base URL. Send your account access token in the Authorization: Bearer header on API requests. Use signed upload and download URLs as returned by the API.
| Method and path | Action |
|---|---|
GET /credits | Read the current monthly allowance and available balance. |
POST /uploads | Start a private audio upload and get a temporary PUT URL. |
GET /uploads/{upload_id} | Check the upload and validation status. |
POST /quotes | Validate any uploaded audio and get a credit quote. |
POST /jobs | Submit a quoted job. |
GET /jobs | Browse your job history. |
GET /jobs/{job_id} | Check status and get completed downloads. |
POST /jobs/{job_id}/cancel | Cancel a queued or running job. |
Separate tracks
Send the file name, content type and byte size to POST /uploads. PUT a WAV, MP3 or M4A file to the returned URL with its required headers. Uploads can be up to 64 MiB. Then send the upload ID to POST /quotes. The quote pins the validated file version so the job processes the same audio. If validation is still in progress, retry after the delay in Retry-After.
{
"operation": "separate_tracks",
"upload_id": "abc123abc123abc123abc123abc123ab",
"stem_count": 4
}Separation returns four aligned stereo WAVs for vocals, drums, bass and other instruments. The backing track combines the three non-vocal stems.
Generate music
Send a prompt, a target length from 1 to 300 seconds per take, and vocals or instrumental mode to POST /quotes. Use reference_upload_id to guide the composition with uploaded audio in either mode. You can supply lyrics for a vocal job. Each completed job returns two stereo WAV takes with their actual durations, which can be shorter than the target.
{
"operation": "generate_music",
"mode": "vocals",
"prompt": "Upbeat pop with warm synths and an English vocal about starting over.",
"duration_seconds": 30,
"reference_upload_id": "def456def456def456def456def456de"
}Submit and download
Send the quote_id to POST /jobs with an Idempotency-Key header. Reusing the key with the same request returns the original job.
{
"quote_id": "abc123def456abc123def456abc123de"
}Poll the job while it is queued, running or canceling. A completed job includes file durations, sample rates, channels and signed download URLs. Read the job again to refresh links while the files are retained. Job history uses cursor pagination.
Credits
Both tools draw from your monthly balance. Standard separation costs one credit per minute of source audio. The API measures credits in whole units of one-sixtieth of a credit and rounds fractional seconds up. Four minutes of separation costs 240 units, or four credits. Generation costs one unit per target second per take through 60 seconds and 2.25 units per additional second per take. Two one-minute takes cost two credits, and two five-minute takes cost twenty.
Jobs reserve the quoted amount when accepted and charge it when completed. A failed or canceled job releases the reservation. A 402 response indicates insufficient credits. A 409 can indicate an expired quote, an upload still being validated or an idempotency conflict. A 422 can indicate invalid audio or unsupported settings.
