Skip to main content

MiniMax voice cloning HTTP API

Clone a MiniMax voice and generate demo audio.

This interface creates MiniMax voices. First obtain an API key and configure the environment variable. Examples read DASHSCOPE_API_KEY.

Service endpoint

HTTP Request URL: POST https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation Base URL (base_url): https://dashscope.aliyuncs.com/api/v1.
Third-party models (MiniMax) currently only support invocation via the dashscope.aliyuncs.com domain and do not yet support dedicated domains.

Request headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer <your_api_key>
Content-TypestringYesapplication/json; charset=utf-8

Create a voice

A voice cloning request generates a demo audio clip. The demo audio is billed additionally at the synchronous TTS unit price of the selected model.

Request Body

model string — Required The speech model used to generate the demo audio.Supported models:
  • MiniMax/speech-2.8-hd
  • MiniMax/speech-02-hd
  • MiniMax/speech-2.8-turbo
  • MiniMax/speech-02-turbo
input object — Required
action string — Required Set to voice_clone.text string — RequiredThe text to synthesize as demo audio for the cloned voice. Maximum: 1,000 characters.
The demo audio is billed at the standard TTS rate per character. For pricing details, see MiniMax model pricing.
  • Interjection tags: When using speech-2.8-hd or speech-2.8-turbo, you can insert interjection tags in the text. Supported interjections: (laughs) (laughter), (chuckle) (chuckle), (coughs) (cough), (clear-throat) (throat clearing), (groans) (groan), (breath) (normal breath), (pant) (panting), (inhale) (inhale), (exhale) (exhale), (gasps) (gasp), (sniffs) (sniff), (sighs) (sigh), (snorts) (snort), (burps) (burp), (lip-smacking) (lip smacking), (humming) (humming), (hissing) (hissing), (emm) (hesitation), (whistles) (whistle), (sneezes) (sneeze), (crying) (crying), (applause) (applause)
audio_url string — RequiredThe URL of the audio file to clone. The audio must meet the following requirements:
  • Format: mp3, m4a, or wav
  • Duration: at least 10 seconds and no more than 5 minutes
  • File size: no more than 20 MB
clone_prompt object — OptionalA sample audio clip for voice cloning. Providing this parameter improves voice similarity and stability during synthesis. If you use this parameter, prepare a short sample audio clip.
prompt_audio string — OptionalThe URL of the sample audio file. The audio must meet the following requirements:
  • Format: mp3, m4a, or wav
  • Duration: less than 8 seconds
  • File size: no more than 20 MB
prompt_text string — OptionalThe transcript of the sample audio. The text must match the audio content exactly and end with a punctuation mark.
voice_id string — RequiredThe ID of the cloned voice (for example, "MiniMax001"). The ID must follow these naming rules:
  • Length: 8 to 256 characters
  • Must start with a letter
  • Allowed characters: letters, digits, hyphens (-), and underscores (_)
  • Must not end with a hyphen (-) or underscore (_)
  • Must be unique across all existing voice IDs. Duplicate IDs return an error.
The voice ID must be globally unique across all voices in your account. Include a timestamp or other unique identifier in the ID to avoid conflicts.
language_boost enum<string> — OptionalDefault value: null.Whether to enhance recognition accuracy for a specific language or dialect. Set to auto to let the model detect the language automatically.
Chinese, Chinese,Yue, English, Arabic, Russian, Spanish, French, Portuguese, German, Turkish, Dutch, Ukrainian, Vietnamese, Indonesian, Japanese, Italian, Korean, Thai, Polish, Romanian, Greek, Czech, Finnish, Hindi, Bulgarian, Danish, Hebrew, Malay, Persian, Slovak, Swedish, Croatian, Filipino, Hungarian, Norwegian, Slovenian, Catalan, Nynorsk, Tamil, Afrikaans,auto
need_noise_reduction boolean — OptionalDefault: false.Whether to enable noise reduction for the audio used for cloning.need_volume_normalization boolean — OptionalDefault: false.Whether to enable volume normalization.aigc_watermark boolean — OptionalDefault: false.Whether to add an audio rhythm marker to the end of the synthesized demo audio.

Request examples

  • MiniMax/speech-2.8-turbo
curl -X POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json; charset=utf-8' \
  -d '{
    "input": {
      "action": "voice_clone",
      "voice_id": "bailian-test-voice-22",
      "audio_url": "https://dashscope.oss-cn-beijing.aliyuncs.com/samples/audio/cosyvoice/cosyvoice-zeroshot-sample.wav",
      "text": "今天天气怎么样?"
    },
    "model": "MiniMax/speech-2.8-turbo"
  }'

Response body

request_id stringThe unique identifier of this request.output object
input_sensitive booleanWhether the input audio triggered content moderation.input_sensitive_type integerThe type of content moderation violation detected in the input audio:
  • 0: Normal (no violation)
  • 1: Severe violation
  • 2: Pornographic content
  • 3: Advertising
  • 4: Prohibited content
  • 5: Abusive language
  • 6: Violent or terrorist content
  • 7: Other
demo_audio stringURL of the demo audio.base_resp object
status_code integerStatus code:
  • 0: Success
  • 1000: Unknown error
  • 1001: Timeout
  • 1002: Rate limit exceeded
  • 1004: Authentication failed
  • 1013: Internal server error
  • 2013: Invalid input format
  • 2038: Insufficient permissions for voice cloning. Check your account authentication status.
status_msg stringA description of the status.
usage objectCharacter usage for this request.
characters integerThe number of characters in the input text.

Response examples

  • MiniMax/speech-2.8-turbo
{
    "output": {
        "base_resp": {
            "status_code": 0,
            "status_msg": "success"
        },
        "demo_audio": "https://minimax-algeng-chat-tts.oss-cn-wulanchabu.aliyuncs.com/audio%2Feffect%2F05fdf023562aea84632d2a8c01c2366f_1773059375796_1311.mp3?Expires=1773232175&OSSAccessKeyId=YOUR_ACCESS_KEY_ID&Signature=YOUR_SIGNATURE",
        "input_sensitive": false,
        "input_sensitive_type": 0
    },
    "usage": {
        "characters": 18
    },
    "request_id": "b1160386-ebf1-913f-9275-ef176c5e1c91"
}

Use and manage the voice

Use the request’s voice_id for speech synthesis. To query available voice IDs or delete a voice, see Voice management.

Errors

See Error codes.