Clone voices from audio samples instantly with minimal setup.
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
const client = new ElevenLabsClient({ apiKey: "your-api-key" });
// Access this API via: client.voices.ivcCreate a voice using instant voice cloning from audio samples.
/**
* Create voice with instant voice cloning
*/
client.voices.ivc.create(
request: BodyAddVoiceV1VoicesAddPost,
requestOptions?: RequestOptions
): HttpResponsePromise<AddVoiceIvcResponseModel>;
interface BodyAddVoiceV1VoicesAddPost {
/** Name for the cloned voice */
name: string;
/** Audio samples for cloning (one or more files) */
files: File[];
/** Voice description */
description?: string;
/** Labels/tags for the voice as serialized JSON string */
labels?: string;
/** If set, will remove background noise for voice samples using audio isolation model */
removeBackgroundNoise?: boolean;
}
interface AddVoiceIvcResponseModel {
/** ID of the created voice */
voiceId: string;
/** Whether the voice requires verification before use */
requiresVerification: boolean;
}import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
import { readFile } from "fs/promises";
const client = new ElevenLabsClient({ apiKey: "your-api-key" });
// Load audio sample
const audioFile = await readFile("sample.mp3");
// Create voice with instant cloning
const result = await client.voices.ivc.create({
name: "My Custom Voice",
files: [new File([audioFile], "sample.mp3")],
description: "A custom cloned voice",
labels: {
accent: "american",
gender: "male",
},
});
console.log("Created voice ID:", result.voice_id);