Trillet AI logo

Clone Voice

Turn an audio clip into a voice embedding you can use to create a custom voice.

POSThttps://api.trillet.ai/v1/api/voices/clone

Cloning is the first of two steps. This endpoint sends your clip to Cartesia and returns its voice embedding. Nothing is saved to your workspace yet: pass the returned embedding to Create Custom Voice to create the voice.

Only the audio file is read. Form fields such as name, description or language are not used: this call does not create a voice. Send those values to Create Custom Voice instead.

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Request Body

The request body should be sent as multipart/form-data.

filefilerequired

Audio clip to clone the voice from. One file, up to 50MB. The clip is sent to Cartesia with noise enhancement turned on.

Response

200 with Cartesia's clone response, passed through unchanged. Its embedding is what Create Custom Voice needs.

embeddingarray

The voice embedding. Send it as-is to Create Custom Voice.

Errors

StatusBodyWhen
400{"error": "Audio file is required"}No file in the request
500{"error": "..."}Cartesia refused the clip, or anything else went wrong
curl -X POST https://api.trillet.ai/v1/api/voices/clone \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID" \
  -F "file=@sample.wav"
{
  "embedding": [0.0123, -0.0456, 0.0789]
}

Last updated on