4Z API

Quick Voice Cloning

Endpoint: POST https://4zapi.com/minimax/v1/voice_clone

https://platform.minimaxi.com/docs/api-reference/voice-cloning-clone The uploaded audio file format must be: mp3, m4a, wav The duration of the uploaded audio file must be at least 10 seconds and no more than 5 minutes The size of the uploaded audio file must not exceed 20 MB If this parameter is used, both sub-properties (prompt_audio, prompt_text) are required

Request body (application/json)

  • file_id (integer, required): The file_id of the audio to be cloned, obtained through the file upload interface. Audio requirements: mp3/m4a/wav format, 10 seconds to 5 minutes, <20MB
  • voice_id (string, required): Custom voice ID (length 8-256, must start with a letter, allows numbers/letters/-/, cannot end with -/)
  • accuracy (number): ASR similarity threshold, default 0.7, range [0, 1].
  • aigc_watermark (boolean): Whether to add an audio rhythm identifier at the end of the preview audio
  • audio_data (string): The base64 audio of the audio to be cloned. (At least one of audio_url or audio_data must be provided)
  • audio_url (string): The URL address of the audio to be cloned (http/https link). Audio specifications: mp3/m4a/wav, recommended duration 10 seconds to 5 minutes, size ≤ 20MB.
  • clone_prompt (object): Example audio object to enhance similarity and stability, obtained from the uploaded example audio
  • language_boost (string): Enhance recognition capabilities for a specific language/dialect. Can be set to auto for automatic detection or specify a specific language
  • model (string): Voice model used for the preview audio: speech-2.6-hd, speech-2.6-turbo, speech-02-hd, speech-02-turbo
  • need_noise_reduction (boolean): Whether to enable noise reduction
  • need_volume_normalization (boolean): Whether to enable volume normalization
  • output_format (string): The return format of the preview audio, default hex, options are url / hex (url valid for 24h).
  • text (string): Cloning preview text (limited to 1000 characters, supports filler word tags)
  • text_validation (string): The expected text of the audio cloning sample, ≤ 200 characters; the service performs ASR recognition and compares similarity, and will reject if below accuracy.

Request example

{
  "aigc_watermark": false,
  "clone_prompt": {
    "prompt_audio": 987654321,
    "prompt_text": "This voice sounds natural and pleasant."
  },
  "file_id": 365182159339614,
  "language_boost": "English",
  "model": "speech-2.8-hd",
  "need_noise_reduction": true,
  "need_volume_normalization": true,
  "text": "A gentle breeze sweeps across the soft grass(breath), carrying the fresh scent along with the songs of birds.",
  "voice_id": "MyCustomVoice003"
}