Skip to content
Get started

Clone a voice

voices.clone(VoiceCloneParams**kwargs) -> VoiceCloneResponse
POST/voices/clone

Clone a voice from an audio recording. Send audio as a base64-encoded string. The cloned voice will be available in GET /voices.

ParametersExpand Collapse
audio: str

Base64-encoded audio data (max ~7.5MB decoded)

maxLength10000000
content_type: Literal["audio/webm", "audio/wav", "audio/mpeg", 3 more]

MIME type of the audio

One of the following:
"audio/webm"
"audio/wav"
"audio/mpeg"
"audio/ogg"
"audio/mp4"
"video/webm"
language: Literal["en", "fr", "es", 5 more]

Language of the voice

One of the following:
"en"
"fr"
"es"
"de"
"it"
"pt"
"ru"
"zh"
name: str

Name for the cloned voice

minLength1
ReturnsExpand Collapse
class VoiceCloneResponse:
id: str
cartesia_voice_id: str
created_at: str
language: str
name: str

Clone a voice

import os
from revox import Revox

client = Revox(
    api_key=os.environ.get("REVOX_API_KEY"),  # This is the default and can be omitted
)
response = client.voices.clone(
    audio="audio",
    content_type="audio/webm",
    language="en",
    name="x",
)
print(response.id)
{
  "id": "id",
  "cartesiaVoiceId": "cartesiaVoiceId",
  "createdAt": "createdAt",
  "language": "language",
  "name": "name"
}
Returns Examples
{
  "id": "id",
  "cartesiaVoiceId": "cartesiaVoiceId",
  "createdAt": "createdAt",
  "language": "language",
  "name": "name"
}