Skip to Content
EnglishAPI ReferenceSynchronous Voice Cloning

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-data or application/json

Request Parameters

ParameterTypeRequiredDescription
audioFile (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_urlstringYes*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.
textstringYesThe text you want to synthesize with the cloned voice.
api_keystringYesYour unique API key for authentication and access. This key is used to verify your requests and link them to your user account.
typeintYes1. Return streaming media 2. Return a playable audio_url (valid for 24 hours)
speed_ratiofloatNoSpeed ratio, range 0.5-2.0, default is 1.0
pitch_ratiofloatNoPitch offset, range -10 to 10 semitones, default is 0
volume_ratiofloatNoVolume ratio, range 0.1-2.0, default is 1.0

*Note:

  • Either audio or audio_url parameter is required, at least one must be provided
  • When using application/json format, only audio_url parameter is supported
  • When using multipart/form-data format, 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 neither audio nor audio_url provided)

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

  1. Text Length Limit: Suitable for short text less than 500 characters
  2. Audio Format: Supports WAV, MP3, M4A formats
  3. Request Format:
    • Using multipart/form-data: Can directly upload audio file (audio parameter) or use audio URL (audio_url parameter)
    • Using application/json: Can only use audio URL (audio_url parameter)
  4. Return Type:
    • type=1: Returns audio stream
    • type=2: Returns audio file URL (valid for 24 hours)
  5. Response Time: Usually returns results within seconds
Last updated on