Voice cloning

Clone a voice from audio you upload, use it on an agent, and list or delete it. Covers the upload fields, limits and errors.

Voice cloning turns a recording of someone speaking into a custom voice for your agents. The new voice belongs to your organization and never appears in another organization's catalog.

Before you start

You must confirm that you hold the rights to the audio and have the speaker's consent. The request is refused unless consent_confirmed is true, and the confirmation is recorded against the API key or user that made it.

Get consent first

A cloned voice is built from a real person's speech. Only upload audio you have the right to use.

The call needs a key with the agents:write scope, or a full-access key. See API key scopes.

Clone a voice

POST /v1/voices/clone takes multipart/form-data, not JSON.

FieldRequiredDetails
nameYesDisplay name, 1 to 100 characters.
filesYesOne or more audio files. Repeat the field for each file.
consent_confirmedYesMust be true.
engineNoelevenlabs (default) or cartesia.
descriptionNoUp to 500 characters.
languageNoLanguage code. Defaults to en.

Limits:

  • Up to 25 files, and at most 40 MB in total.
  • Files must not be empty.
  • With cartesia, send exactly one file. More than one is refused.
curl -X POST https://api.dialgem.com/v1/voices/clone \
  -H "X-API-Key: $DIALGEM_API_KEY" \
  -F "name=Front desk" \
  -F "description=Warm, unhurried" \
  -F "consent_confirmed=true" \
  -F "files=@sample-1.wav" \
  -F "files=@sample-2.wav"

Cloning can take a while, because the voice is built before the call returns. The SDKs never retry an upload.

What comes back

A successful call returns 201 and the voice:

  • id is the Dialgem id. Use it to delete the voice.
  • provider_voice_id is the value to put in an agent's voice_id.
  • is_custom is true for a voice you cloned.
  • created_by identifies who uploaded the audio.
  • name, provider, language and the other catalog fields.

Use it on an agent

Set the agent's voice_id to the voice's provider_voice_id:

curl
curl -X PATCH https://api.dialgem.com/v1/agents/AGENT_ID \
  -H "X-API-Key: $DIALGEM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "voice_id": "PROVIDER_VOICE_ID" }'

See Prompt agents for the rest of the agent fields.

List and delete

GET /v1/voices lists the catalog with your cloned voices first. See Voices for the filters.

DELETE /v1/voices/VOICE_ID removes a voice you cloned, using its id. It returns { "deleted": true, "voice_id": "..." }. Shared catalog voices cannot be deleted, and a voice that belongs to another organization reads as not found. If an agent still uses the voice, you get a 409 naming up to five of those agents. Change their voice first, then delete.

Errors

StatusMeaning
422Consent not confirmed, no files, an empty file, more than 25 files, an unknown engine, or more than one file with cartesia.
413The files total more than 40 MB.
403The key lacks the agents:write scope (INSUFFICIENT_SCOPE).
409On delete, an agent still uses the voice.
502The voice provider is unreachable or refused the request.
503Voice cloning is not available right now.
504The provider did not answer in time. The voice may still have been created, so list your voices before you retry.

Audio the provider cannot use is reported with a 4xx and a message saying why.

Pricing

Call minutes, including the voice engine, are priced under Billing and pricing.