Skip to main content
POST
/
voice_clones
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const voiceClone = await client.voiceClones.create({
  gender: 'male',
  language: 'en',
  name: 'clone-narrator',
  voice_design_id: '550e8400-e29b-41d4-a716-446655440000',
});

console.log(voiceClone.data);
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
voice_clone = client.voice_clones.create(
gender="male",
language="en",
name="clone-narrator",
voice_design_id="550e8400-e29b-41d4-a716-446655440000",
)
print(voice_clone.data)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
voiceClone, err := client.VoiceClones.New(context.TODO(), telnyx.VoiceCloneNewParams{
Gender: telnyx.VoiceCloneNewParamsGenderMale,
Language: "en",
Name: "clone-narrator",
VoiceDesignID: "550e8400-e29b-41d4-a716-446655440000",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", voiceClone.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.voiceclones.VoiceCloneCreateParams;
import com.telnyx.sdk.models.voiceclones.VoiceCloneCreateResponse;

public final class Main {
private Main() {}

public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();

VoiceCloneCreateParams params = VoiceCloneCreateParams.builder()
.gender(VoiceCloneCreateParams.Gender.MALE)
.language("en")
.name("clone-narrator")
.voiceDesignId("550e8400-e29b-41d4-a716-446655440000")
.build();
VoiceCloneCreateResponse voiceClone = client.voiceClones().create(params);
}
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

voice_clone = telnyx.voice_clones.create(
gender: :male,
language: "en",
name: "clone-narrator",
voice_design_id: "550e8400-e29b-41d4-a716-446655440000"
)

puts(voice_clone)
telnyx voice-clones create \
--api-key 'My API Key' \
--gender male \
--language en \
--name clone-narrator \
--voice-design-id 550e8400-e29b-41d4-a716-446655440000
curl --request POST \
--url https://api.telnyx.com/v2/voice_clones \
--header 'Content-Type: application/json' \
--data '
{
"name": "clone-narrator",
"voice_design_id": "550e8400-e29b-41d4-a716-446655440000",
"language": "en",
"gender": "male",
"provider": "telnyx"
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telnyx.com/v2/voice_clones",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'clone-narrator',
'voice_design_id' => '550e8400-e29b-41d4-a716-446655440000',
'language' => 'en',
'gender' => 'male',
'provider' => 'telnyx'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
  "data": {
    "record_type": "voice_clone",
    "id": "660f9511-f3ac-52e5-b827-557766551111",
    "source_voice_design_id": "550e8400-e29b-41d4-a716-446655440000",
    "source_voice_design_version": 1,
    "name": "clone-narrator",
    "language": "en",
    "gender": "male",
    "label": "Speak in a warm, friendly tone",
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z",
    "provider": "Telnyx",
    "provider_supported_models": [
      "Qwen3TTS"
    ],
    "provider_voice_id": "660f9511-f3ac-52e5-b827-557766551111"
  }
}
{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}
{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}
{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}
{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}

Body

application/json

Request body for creating a voice clone from an existing voice design.

name
string
required

Name for the voice clone.

Required string length: 1 - 255
voice_design_id
string<uuid>
required

UUID of the source voice design to clone.

language
string
required

ISO 639-1 language code for the clone (e.g. en, fr, de).

gender
enum<string>
required

Gender of the voice clone.

Available options:
male,
female,
neutral
provider
enum<string>
default:telnyx

Voice synthesis provider. Case-insensitive. Defaults to telnyx.

Available options:
telnyx,
minimax,
Telnyx,
Minimax

Response

Voice clone created successfully.

Response envelope for a single voice clone.

data
object

A voice clone object.