POST /v1/voice-cloning

Voice cloning

Speak new text in the voice of one reference clip, and return a download link for the audio.

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

Authenticate with Authorization: Bearer and an API key. Send model and text before file. The 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-cloning/{job_id}.

FieldTypeDescription
modelRequiredstringCatalogue id of the voice-cloning model. This part must be sent before the file.
textRequiredstringThe words to speak in the reference voice. Send this part before the file. The length is priced before the clip is stored.
reference_textstringTranscript of the reference clip. Required when the model page says this model needs that transcript. Send it before the file.
fileRequiredfileReference clip. One voice for this request. 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 generated audio 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-cloning/batch

Speak up to 50 texts in one voice. All texts use the same model, the same parameters, the same reference clip, and the same reference_text when that model needs the clip transcript. Send model, params, reference_text, and items before file. items is a JSON array. Each item has text and an optional name. The clip must be under 25 MB.

The response contains the batch identifier. Retrieve progress with GET /v1/voice-cloning/batch/{batch_id}. An account may have two open batches. The length of every text is priced before the clip is stored. A successful batch is charged $0.05 once. Each text is charged for the generated audio duration in minutes.

Example

curl https://api.pascalai.co/v1/voice-cloning \
  -H "Authorization: Bearer $PASCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F model=sarvam-clone \
  -F text="Keep walking toward the river." \
  -F params='{"language":"en-IN","output_format":"wav","output_sample_rate":"source","output_channels":"source"}' \
  -F file=@voice.wav

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

Models