Audio

Voice Cloning

Clone voices from audio samples using MiniMax. Upload a voice sample, create a clone, and use it for TTS.

Step 1: Upload Voice Sample

POST/v1/audio/voice-clone/upload

Multipart Form Parameters

filefileformrequired

Audio file with clear speech (10-60 seconds recommended)

purposestringform

Upload purpose

Default: voice_clone

Upload Sample
curl -X POST https://api.metriqual.com/v1/audio/voice-clone/upload \
  -H "Authorization: Bearer mql_your_key" \
  -F file=@voice_sample.mp3

Step 2: Clone Voice

POST/v1/audio/voice-clone

Body Parameters

file_idstringrequired

File ID from the upload step

voice_idstringrequired

Custom voice ID for the clone (your naming)

After cloning, use the voice_id in TTS requests via the voice_setting parameter.
Clone Voice
curl -X POST https://api.metriqual.com/v1/audio/voice-clone \
  -H "Authorization: Bearer mql_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "file_abc123",
    "voice_id": "my-cloned-voice"
  }'
TypeScript SDK
// Upload + clone
const clone = await mql.audio.cloneVoice({
  file_id: 'file_abc123',
  voice_id: 'my-cloned-voice'
});

// Use cloned voice for TTS
const speech = await mql.audio.speech({
  model: 'speech-02-hd',
  text: 'Hello in my cloned voice!',
  voice_setting: { voice_id: 'my-cloned-voice' }
});
Python SDK
# Upload voice sample
with open("voice_sample.mp3", "rb") as f:
    upload = mql.audio.upload_voice_clone(f)

# Clone the voice
clone = mql.audio.clone_voice(
    voice_id="my-cloned-voice",
    file_id=upload["file_id"],
)

# Or upload + clone in one step
with open("voice_sample.mp3", "rb") as f:
    clone = mql.audio.upload_and_clone_voice(f, "my-cloned-voice")