Voice Cloning API

Create custom AI voices from audio samples with our Voice Cloning API. Upload audio, clone voices, and use them in the Text to Speech or AI Dubbing.
Voice Cloning
Custom Voices
REST API
Voice Cloning Interface
Trusted by over 500,000+ users

Powerful Voice Cloning API features

Everything you need to integrate professional voice cloning into your applications
Unlimited
Unlimited Voice CloningCreate unlimited custom voices from audio samples. Upload audio in MP3, WAV, AAC, M4A, or FLAC format.
Premium Quality
High-Quality AudioGenerate natural-sounding speech with advanced AI technology. Support for multiple audio formats and high-quality output.
Developer Friendly
Easy IntegrationSimple REST API with comprehensive documentation. Integrate voice cloning into your applications with just a few API calls.

Voice Cloning API workflow

Create custom voices with just a few simple API calls
01

Upload Audio Sample

Get a presigned URL and upload your audio file in supported formats like MP3, WAV, AAC, M4A, or FLAC.
API Request
curl -X GET "https://dubsmart.ai/api/v1/upload?region=EU&fileExtension=mp3" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Response:
{
  "url": "https://storage.dubsmart.ai/uploads/...",
  "key": "uploads/user_id/filename.mp3"
}

# Upload file
curl -X PUT -T your_audio_file.mp3 "https://storage.dubsmart.ai/uploads/..."
02

Create Custom Voice

Create a custom voice using the uploaded audio sample. Provide a name and the file key from the upload step.
API Request
curl -X POST "https://dubsmart.ai/api/v1/custom-voices/create" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Custom Voice",
    "examplePath": "uploads/user_id/filename.mp3"
  }'

# Response:
{
  "id": "67c123...",
  "name": "My Custom Voice",
  "examplePath": "https://...",
  "createdAt": "2024-01-15T10:30:00Z"
}'
03

Use in TTS and AI Dubbing Projects

Use your custom voice ID in TTS and AI Dubbing projects.
API Request
curl -X POST "https://dubsmart.ai/api/v1/projects/tts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My TTS Project",
    "segments": [
      {
        "text": "Hello world!",
        "voice": "67c123...",
        "language": "en"
      }
    ]
  }'

Voice Cloning API endpoints

Complete API reference with examples for all endpoints
GET
/upload

Get upload file URL

Get presigned URL for file upload and return file key
Request
JSON
Query Parameters:
- region: string (default: "EU")
- fileExtension: string (mp3, wav, aac, m4a, flac)
Response
JSON
{
  "url": "https://storage.dubsmart.ai/uploads/...",
  "key": "uploads/user_id/filename.mp3"
}

Voice Cloning API code examples

Ready-to-use code examples in multiple programming languages
JavaScript Example
// JavaScript/Node.js Example
const axios = require('axios');

const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://dubsmart.ai/api/v1';

async function createCustomVoice() {
  try {
    // Step 1: Get upload URL
    const uploadResponse = await axios.get(`${BASE_URL}/upload`, {
      params: {
        region: 'EU',
        fileExtension: 'mp3'
      },
      headers: { 'Authorization': `Bearer ${API_KEY}` }
    });

    console.log('Upload URL:', uploadResponse.data.url);
    
    // Step 2: Upload audio file (you would use the presigned URL here)
    // This is typically done with a PUT request to the presigned URL
    
    // Step 3: Create custom voice
    const voiceResponse = await axios.post(`${BASE_URL}/custom-voices/create`, {
      name: 'My Custom Voice',
      examplePath: uploadResponse.data.key
    }, {
      headers: { 'Authorization': `Bearer ${API_KEY}` }
    });

    console.log('Custom voice created:', voiceResponse.data);
    
    // Step 4: List custom voices
    const voicesResponse = await axios.post(`${BASE_URL}/custom-voices/list`, {
      limit: 10
    }, {
      headers: { 'Authorization': `Bearer ${API_KEY}` }
    });

    console.log('Custom voices:', voicesResponse.data.items);
    
    return voiceResponse.data;
  } catch (error) {
    console.error('Error:', error.response?.data || error.message);
  }
}

// Usage
createCustomVoice();

Voice Cloning API FAQ

What is the Voice Cloning API and how does it work?Our Voice Cloning API allows you to create custom AI voices from audio samples. Simply upload an audio file, create a custom voice, and use it in your TTS and AI Dubbing projects.
What audio formats are supported for voice cloning?We support MP3, WAV, AAC, M4A, and FLAC audio formats. The audio file should be from 20 seconds without background noise for optimal voice cloning results.
How many custom voices can I create?On paid plans, you can create unlimited custom voices.
How long does it take to create a custom voice?Voice cloning typically takes few seconds depending on the audio length and complexity.
Can I use custom voices in TTS projects?Yes! Once created, your custom voices can be used in TTS projects by referencing the voice ID. They work seamlessly with our Text-to-Speech API for generating natural-sounding speech.
Can I use custom voices in AI Dubbing projects?Yes! Once created, your custom voices can be used in AI Dubbing projects by referencing the voice ID. They work seamlessly with our AI Dubbing API for generating natural-sounding speech.
Is my audio data secure and private?Absolutely. We take data privacy seriously. Your audio files are encrypted and stored securely. You can delete custom voices and their associated audio data at any time.