POST /v1/voice-conversion

Voice conversion

Keep the words of a source clip and speak them in the voice of a reference clip. The response is a download link for the audio.

POST https://api.pascalai.co/v1/voice-conversion
Content-Type: multipart/form-data

Authenticate with Authorization: Bearer and an API key. Send model before the files. Each clip must be under 25 MB. The call remains open for up to 4 minutes. When processing has finished inside that window, the body is the job. When status is queued or running, retrieve the same object with GET /v1/voice-conversion/{job_id}.

FieldTypeDescription
modelRequiredstringCatalogue id of the voice-conversion model. This part must be sent before the files.
fileRequiredfileSource clip. The words in this clip stay. The file must be under 25 MB.
referenceRequiredfileReference clip. This voice replaces the source voice. The file must be under 25 MB.
paramsstringJSON object for that model, encoded as a string. Omit the field, or send an empty string, to use the defaults. The value must be a JSON object. The fields are on the model page.
namestringOptional label stored on the job and returned as name.

Response

200 with the job. A successful request is charged $0.05 plus the source clip duration in minutes. result.artifacts contains the audio. url is the download link. Download the file within one day. The file is deleted after that. The job record remains.

Batch

POST /v1/voice-conversion/batch

Convert up to 50 source clips into one voice. All of them use the same model, the same parameters, and the same reference clip. Send model and params before the files. Send the target voice once as reference. Send each source as file. Each clip must be under 25 MB.

The response contains the batch identifier. Retrieve progress with GET /v1/voice-conversion/batch/{batch_id}. An account may have two open batches. The request is accepted when the API wallet covers $0.05 plus one billed minute of the model. A successful batch is charged $0.05 once. Each source clip is charged for its duration in minutes.

Example

curl https://api.pascalai.co/v1/voice-conversion \
  -H "Authorization: Bearer $PASCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F model=cosyvoice3-voice-conversion \
  -F params='{"output_format":"wav"}' \
  -F file=@source.wav \
  -F reference=@reference.wav

curl https://api.pascalai.co/v1/voice-conversion/$JOB_ID \
  -H "Authorization: Bearer $PASCAL_API_KEY"

Models