Skip to content
DUETA
Docs

Separate a recording in four calls

Get a key, upload one file, run the job, and download one clean track per speaker.

On this page
You need
  • An account. Signing up grants $20 of credit; a job costs $0.50 per minute of the longest input.
  • A recording: WAV, AIFF, FLAC, MP3, M4A / AAC, OGG / Opus, WMA, CAF, or AMR. Up to 200 MB per file. Video is refused.
  • curl and jq, or Python with requests, or Node 18+.

Get a key

POST/v1/auth/signup
POST/v1/keys

Sign up (or log in) to get a session token, then trade it for an API key. The key is returned once. Every call below sends it as Authorization: Bearer mk_live_…. Details in Authenticate.

bash
curl -X POST https://dueta.ai/v1/keys \
  -H "Authorization: Bearer eyJ..." \
  -H "Content-Type: application/json" \
  -d '{"name": "production-server"}'
# -> {"id": "...", "name": "production-server", "prefix": "mk_live_8fQ2",
#     "key": "mk_live_8fQ2...", "created_at": "..."}   <- full secret, shown once

export DUETA_API_KEY="mk_live_8fQ2..."

Upload a recording

POST/v1/uploads
PUT/v1/uploads/{id}/content

Declare the file, then PUT its bytes as a raw body to the content_url the declaration returns. When the last byte lands the upload turns ready with its measured duration. Nothing is charged yet. Resuming and the full field list are in Upload audio.

bash
curl -X POST https://dueta.ai/v1/uploads \
  -H "Authorization: Bearer $DUETA_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"filename\": \"conversation.wav\", \"size_bytes\": $(wc -c < conversation.wav)}"
# -> 201 {"id": "upl_9f2c7a41d0e8", "state": "pending",
#         "content_url": "/v1/uploads/upl_9f2c7a41d0e8/content", ...}

Run the job

POST/v1/jobs/separation

Name the upload id. The job is quoted on the upload's duration, the credit is held, and the job is queued. Omit pipeline to run every step. The other product, one file per microphone, is in Run a separation.

bash
curl -X POST https://dueta.ai/v1/jobs/separation \
  -H "Authorization: Bearer $DUETA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inputs": ["upl_9f2c7a41d0e8"],
       "pipeline": {"super_resolution": false}}'
# -> 201, the job. Omit "pipeline" to run every step.

Download the tracks

GET/v1/jobs/{id}
GET/v1/jobs/{id}/stems/{name}

Poll until status is succeeded, then fetch each name in result.stems[]. Streaming and callbacks are in Track a job; FLAC and ZIP downloads in Get results.

bash
while :; do
  JSON=$(curl -sS -H "Authorization: Bearer $DUETA_API_KEY" https://dueta.ai/v1/jobs/$JOB_ID)
  echo "$JSON" | jq -r '[.status, .stage, (.progress * 100 | floor | tostring) + "%"] | join("  ")'
  case $(echo "$JSON" | jq -r .status) in
    succeeded) break ;;
    failed|canceled) echo "$JSON" | jq -r .error; exit 1 ;;
  esac
  sleep 2
done
bash
# WAV, byte for byte as rendered:
curl -H "Authorization: Bearer $DUETA_API_KEY" -o track.wav "https://dueta.ai/v1/jobs/$JOB_ID/stems/$STEM_NAME"

# FLAC, the same samples losslessly at about half the size:
curl -H "Authorization: Bearer $DUETA_API_KEY" -o track.flac "https://dueta.ai/v1/jobs/$JOB_ID/stems/$STEM_NAME?format=flac"

Cases

402
Not enough credit for the job. Nothing was charged; top up and submit the same upload id again.
409
The upload is not ready yet, or your email is unverified on a deployment that requires it. Finish the upload, or click the verification link.
429
More than 5 jobs in progress, or more than 20 submissions a minute. Wait Retry-After seconds.
415
The file is video. Export the audio track and upload that.