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/uploadMultipart Form Parameters
filefileformrequiredAudio file with clear speech (10-60 seconds recommended)
purposestringformUpload 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.mp3Step 2: Clone Voice
POST
/v1/audio/voice-cloneBody Parameters
file_idstringrequiredFile ID from the upload step
voice_idstringrequiredCustom 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")