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
Spec | Value |
---|---|
Max text | 3,000 characters |
Max audio | 50MB |
Character billing | 2x character rate |
S3 storage integration | Yes |
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
Parameter | Type | Required | Description |
---|---|---|---|
text | string | Yes | Text to synthesize (max 3000 characters) |
language | string | Yes | Target language code (see supported languages) |
speaker_audio | file | Yes* | Audio file for voice cloning (max 50MB) |
speaker_audio_url | string | Yes* | URL to audio file for voice cloning |
cleanup_voice | boolean | No | Apply denoising to speaker audio (default: true) |
*Either speaker_audio
or speaker_audio_url
is required.
Example Request (cURL)
Example Response
GET /api/v1/voice-cloning/languages
— Get Supported Languages
Retrieve the list of supported languages for voice cloning.
Example Request
Example Response
GET /api/v1/voice-cloning/info
— Get Service Information
Get detailed information about the voice cloning service capabilities and limitations.
Example Request
Example Response
Integration Examples
Ready-to-use code examples for popular programming languages and frameworks.
JavaScript/Node.js Example
Supported Languages
The Voice Cloning API supports 14 languages for high-quality voice synthesis:
Code | Language |
---|---|
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 🇮🇳 |
Troubleshooting & Error Handling
HTTP Error Codes
Code | Error Type | Description | Solution |
---|---|---|---|
400 | Bad Request | Invalid request parameters | Check parameter format and values |
401 | Unauthorized | Missing or invalid authentication | Verify API token in Authorization header |
402 | Payment Required | Insufficient character balance | Top up your account or reduce text length |
413 | Payload Too Large | Audio file exceeds size limit | Reduce file size to under 50MB |
422 | Unprocessable Entity | Validation errors | Check the errors field in response |
429 | Too Many Requests | Rate limit exceeded | Wait before making more requests |
500 | Internal Server Error | Service unavailable | Try 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.