Synchronous Voice Cloning
Suitable for short text (less than 500 characters) voice cloning, returns results immediately.
Request Information
- Method:
POST - Endpoint:
/api/instant/clone-sync - Content Type:
multipart/form-dataorapplication/json
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
audio | File (binary) | Yes* | Audio file for voice cloning. Supported formats include WAV, MP3, and M4A. Only supports multipart/form-data format. You must provide either audio or audio_url. |
audio_url | string | Yes* | Publicly accessible audio file URL (WAV, MP3, M4A) for voice cloning. Supports both multipart/form-data and application/json formats. You must provide either audio or audio_url. |
text | string | Yes | The text you want to synthesize with the cloned voice. |
api_key | string | Yes | Your unique API key for authentication and access. This key is used to verify your requests and link them to your user account. |
type | int | Yes | 1. Return streaming media 2. Return a playable audio_url (valid for 24 hours) |
speed_ratio | float | No | Speed ratio, range 0.5-2.0, default is 1.0 |
pitch_ratio | float | No | Pitch offset, range -10 to 10 semitones, default is 0 |
volume_ratio | float | No | Volume ratio, range 0.1-2.0, default is 1.0 |
*Note:
- Either
audiooraudio_urlparameter is required, at least one must be provided - When using
application/jsonformat, onlyaudio_urlparameter is supported - When using
multipart/form-dataformat, both parameters are supported
Response
Success Response
Return Type: Returns streaming media or audio_url based on the type parameter
{
"audio_url": "https://pub-86e8fdaa1c484bfb856e9d0f2cf54e2a.r2.dev/1748152296147_89ce52d0_voice_clone_sync_b5f0ff03.mp3"
}Error Response
- 400 Bad Request: Missing required parameters (e.g.,
api_key, or neitheraudionoraudio_urlprovided)
Example Requests
Using Audio File
curl -X POST https://aivoiceclonefree.com/api/instant/clone-sync \
-F "[email protected]" \
-F "text=Hello, this is a test message" \
-F "api_key=your_api_key_here" \
-F "type=2"Using Audio URL
curl -X POST https://aivoiceclonefree.com/api/instant/clone-sync \
-F "audio_url=https://example.com/sample.mp3" \
-F "text=Hello, this is a test message" \
-F "api_key=your_api_key_here" \
-F "type=2"Using Audio Processing Parameters
curl -X POST https://aivoiceclonefree.com/api/instant/clone-sync \
-F "[email protected]" \
-F "text=Hello, this is a test message" \
-F "api_key=your_api_key_here" \
-F "type=2" \
-F "speed_ratio=1.2" \
-F "pitch_ratio=2" \
-F "volume_ratio=1.5"Using JSON Format (with audio_url)
curl -X POST https://aivoiceclonefree.com/api/instant/clone-sync \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://example.com/sample.mp3",
"text": "Hello, this is a test message",
"api_key": "your_api_key_here",
"type": 2,
"speed_ratio": 1.2,
"pitch_ratio": 2,
"volume_ratio": 1.5
}'Usage Instructions
- Text Length Limit: Suitable for short text less than 500 characters
- Audio Format: Supports WAV, MP3, M4A formats
- Request Format:
- Using
multipart/form-data: Can directly upload audio file (audioparameter) or use audio URL (audio_urlparameter) - Using
application/json: Can only use audio URL (audio_urlparameter)
- Using
- Return Type:
type=1: Returns audio streamtype=2: Returns audio file URL (valid for 24 hours)
- Response Time: Usually returns results within seconds
Last updated on