Verbatik LogoVerbatik

Voice Cloning API Overview

Advanced AI-powered multilingual voice cloning technology

The Voice Cloning API provides state-of-the-art text-to-speech voice cloning capabilities powered by advanced AI technology. Clone any voice using a sample audio file and generate speech in multiple languages with remarkable accuracy and naturalness.

Key Features

  • 14 supported languages
  • High-quality voice cloning
  • Multiple audio formats
  • Voice enhancement options

Technical Specs

SpecValue
Max text3,000 characters
Max audio50MB
Character billing2x character rate
S3 storage integrationYes

API Endpoints

POST /api/v1/voice-cloning — Clone Voice

Clone a voice using provided text and speaker audio. Supports both file uploads and URL-based audio inputs.

Request Parameters

ParameterTypeRequiredDescription
textstringYesText to synthesize (max 3000 characters)
languagestringYesTarget language code (see supported languages)
speaker_audiofileYes*Audio file for voice cloning (max 50MB)
speaker_audio_urlstringYes*URL to audio file for voice cloning
cleanup_voicebooleanNoApply denoising to speaker audio (default: true)

*Either speaker_audio or speaker_audio_url is required.

Example Request (cURL)

curl -X POST "https://api.verbatik.com/api/v1/voice-cloning" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: multipart/form-data" \
  -F "text=Hello, this is a test of voice cloning technology." \
  -F "language=en" \
  -F "speaker_audio=@/path/to/speaker.wav" \
  -F "cleanup_voice=true"

Example Response

{
  "success": true,
  "audio_url": "https://s3.eu-west-2.amazonaws.com/speak.verbatik.com/voice-cloning/uuid-filename.wav",
  "characters_used": 94,
  "remaining_balance": 9906,
  "language": "en"
}

GET /api/v1/voice-cloning/languages — Get Supported Languages

Retrieve the list of supported languages for voice cloning.

Example Request

curl -X GET "https://api.verbatik.com/api/v1/voice-cloning/languages" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example Response

{
  "success": true,
  "languages": {
    "en": "English 🇺🇸",
    "fr": "French 🇫🇷",
    "de": "German 🇩🇪",
    "es": "Spanish 🇪🇸",
    "it": "Italian 🇮🇹",
    "pt": "Portuguese 🇵🇹",
    "cs": "Czech 🇨🇿",
    "pl": "Polish 🇵🇱",
    "ru": "Russian 🇷🇺",
    "nl": "Dutch 🇳🇱",
    "tr": "Turkish 🇹🇷",
    "ar": "Arabic 🇦🇪",
    "zh-cn": "Mandarin Chinese 🇨🇳",
    "hi": "Hindi 🇮🇳"
  }
}

GET /api/v1/voice-cloning/info — Get Service Information

Get detailed information about the voice cloning service capabilities and limitations.

Example Request

curl -X GET "https://api.verbatik.com/api/v1/voice-cloning/info" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example Response

{
  "success": true,
  "service": "Verbatik Voice Cloning",
  "description": "Advanced AI-powered multilingual voice cloning technology",
  "supported_formats": ["wav", "mp3", "m4a", "ogg", "flv"],
  "max_text_length": 3000,
  "max_audio_size": "50MB",
  "character_rate": "2x (voice cloning uses double character rate)",
  "min_audio_duration": "6 seconds recommended",
  "languages": { /* ... */ }
}

Integration Examples

Ready-to-use code examples for popular programming languages and frameworks.

JavaScript/Node.js Example

const FormData = require('form-data');
const fs = require('fs');
const fetch = require('node-fetch');

async function cloneVoice(text, audioFile, language, apiToken) {
    const formData = new FormData();
    formData.append('text', text);
    formData.append('language', language);
    formData.append('speaker_audio', fs.createReadStream(audioFile));
    formData.append('cleanup_voice', 'true');

    try {
        const response = await fetch('https://api.verbatik.com/api/v1/voice-cloning', {
            method: 'POST',
            headers: {
                'Authorization': `Bearer ${apiToken}`,
                ...formData.getHeaders()
            },
            body: formData
        });

        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }

        const result = await response.json();
        console.log('Voice cloning successful:', result);
        return result;

    } catch (error) {
        console.error('Voice cloning failed:', error);
        throw error;
    }
}

// Usage example
cloneVoice(
    'Hello, this is a test of voice cloning technology.',
    '/path/to/speaker.wav',
    'en',
    'YOUR_API_TOKEN'
).then(result => {
    console.log('Audio URL:', result.audio_url);
}).catch(error => {
    console.error('Error:', error);
});

Supported Languages

The Voice Cloning API supports 14 languages for high-quality voice synthesis:

CodeLanguage
enEnglish 🇺🇸
frFrench 🇫🇷
deGerman 🇩🇪
esSpanish 🇪🇸
itItalian 🇮🇹
ptPortuguese 🇵🇹
csCzech 🇨🇿
plPolish 🇵🇱
ruRussian 🇷🇺
nlDutch 🇳🇱
trTurkish 🇹🇷
arArabic 🇦🇪
zh-cnMandarin Chinese 🇨🇳
hiHindi 🇮🇳

Troubleshooting & Error Handling

HTTP Error Codes

CodeError TypeDescriptionSolution
400Bad RequestInvalid request parametersCheck parameter format and values
401UnauthorizedMissing or invalid authenticationVerify API token in Authorization header
402Payment RequiredInsufficient character balanceTop up your account or reduce text length
413Payload Too LargeAudio file exceeds size limitReduce file size to under 50MB
422Unprocessable EntityValidation errorsCheck the errors field in response
429Too Many RequestsRate limit exceededWait before making more requests
500Internal Server ErrorService unavailableTry again later or contact support

Common Issues & Solutions

"Invalid speaker audio file"

  • Check file format (must be wav, mp3, m4a, ogg, or flv)
  • Ensure file size is under 50MB
  • Verify file is not corrupted
  • Make sure the file contains actual audio data

"Voice cloning timed out"

  • The service has a 5-minute timeout
  • Try with shorter text or smaller audio files
  • Check if the audio file is too large or complex
  • Retry the request after a few minutes

"Insufficient character balance"

  • Voice cloning uses 2x character rate
  • Check user's available character balance
  • Consider upgrading user's plan
  • Reduce text length to fit within available credits

"Unsupported language"

  • Use the /voice-cloning/languages endpoint to get supported languages
  • Ensure language code is lowercase (e.g., 'en', not 'EN')
  • Check for typos in the language code
  • Refer to the supported languages section above

Rate Limiting

The Voice Cloning API is subject to rate limiting to ensure fair usage and optimal performance for all users.

  • Rate limits are configured per user tier
  • Implement exponential backoff for retry logic
  • Monitor response headers for rate limit information
  • Contact support if you need higher limits

Security Best Practices

  • API Token Security: Store API tokens securely and never expose them in client-side code
  • HTTPS Only: Always use HTTPS for API requests to ensure data encryption
  • Input Validation: Validate and sanitize all input data before sending to the API
  • Error Handling: Implement proper error handling and don't expose sensitive information

Need Help?

Our support team is here to help you integrate the Voice Cloning API successfully.