Use the HTTP API to create, list, query, update, and delete cloned voices.
Service endpoint(Qwen-Audio-TTS/CosyVoice)
- China (Beijing)
- Singapore
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/tts/customizationReplace {WorkspaceId} with your actual workspace ID.Service endpoint (MiniMax)
HTTP request URL: POST https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
base_url for SDK calls: https://dashscope.aliyuncs.com/api/v1
Third-party models (MiniMax) currently only support access through the dashscope.aliyuncs.com domain and do not support dedicated endpoints.
Request headers
Parameter | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Authentication token in the format |
Content-Type | string | Yes | Media type of the request body. Set to |
Create a voice(Qwen-Audio-TTS/CosyVoice)
Request bodymodelstring(required)The voice cloning model. Valid values:
object(required)The input parameters.
Properties action string(required)The action type.
string(required)The text-to-speech (TTS) model that drives the cloned voice. It must match the model you specify when calling the TTS API; otherwise, synthesis fails.url string(required)The URL of the audio file for voice cloning. The URL must be publicly accessible.prefix string(required)A prefix for the voice name. Only alphanumeric characters are allowed, with a maximum length of 10 characters. The resulting voice name follows this format: {target_model}-{prefix}-{unique_id}.language_hints array[string](optional)Helps the model identify the language of the sample audio to extract voice features more accurately and improve cloning quality. If the specified language doesn't match the actual audio language (for example, setting en when the audio is in Chinese), the system ignores this value and detects the language automatically.This parameter is an array, but the current version processes only the first element.Valid values vary by model:
float(optional)The maximum duration (in seconds) of the reference audio after preprocessing. Valid values: [3.0, 30.0].Default: 10.0.enable_preprocess boolean(optional)Whether to enable audio preprocessing (noise reduction, audio enhancement, and volume normalization). Enable this for recordings with background noise. Disable it for recordings in quiet environments to preserve the original voice characteristics.Default: false.enable_volume_normalization string(optional)Whether to normalize the volume of the sample audio used for voice cloning. Valid values:
"false". | This example uses the Beijing region endpoint. For the Singapore region, use: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/tts/customization.Replace {WorkspaceId} with your actual workspace ID. |
Response bodyrequest_idstringThe unique identifier of this request.outputobjectThe data returned by the model.
Properties voice_id stringThe voice ID. Use it in the voice parameter of the TTS API.objectUsage information for this request.
Properties count integerThe number of voices created. Always 1. |
Create a voice (MiniMax)
A voice cloning request generates a demo audio clip. The demo audio is billed at the synchronous TTS rate of the selected model.
Request bodymodelstring(required)The speech model used to generate the demo audio.Supported models:
object(required)
Properties action string(required)The operation to perform. Set to voice_clone for voice cloning.audio_urlstring(required)The URL of the audio file to clone. The audio must meet the following requirements:
object(optional)A sample audio clip for voice cloning. Providing this parameter improves voice similarity and stability during synthesis.
Properties prompt_audio string(optional)The URL of the sample audio file. The audio must meet the following requirements:
string(optional)The transcript of the sample audio. The text must match the audio content exactly and end with a punctuation mark.string(required)The 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.
string(required)The ID of the cloned voice (for example, "MiniMax001"). The ID must follow these naming rules:
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>(optional) Default: nullWhether to enhance recognition accuracy for a specific language or dialect. Set to auto to let the model detect the language automatically.
Available options 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,autoboolean (optional) Default: falseWhether to enable noise reduction for the audio used for cloning.need_volume_normalizationboolean (optional) Default: falseWhether to enable volume normalization.aigc_watermarkboolean (optional) Default: falseWhether to add an AI watermark to the synthesized demo audio. |
Response bodyrequest_idstringThe unique identifier of this request.outputobject
Properties input_sensitive booleanWhether the input audio triggered content moderation.input_sensitive_typeintegerThe type of content moderation violation detected in the input audio:
stringURL of the demo audio.base_respobject
Properties status_code integerStatus code:
stringA description of the status.objectCharacter usage for this request.
Properties characters integerThe number of characters in the input text. |
Query voice list
Request bodymodelstring(required)The voice cloning model. Valid values:
object(required)The input parameters.
Properties action string(required)Set to list_voice.prefix string(optional)Filters voices by name prefix.page_index integer(optional)The page index.page_size integer(optional)The number of entries per page. | This example uses the Beijing region endpoint. For the Singapore region, use: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/tts/customization.Replace {WorkspaceId} with your actual workspace ID. |
Response bodyrequest_idstringThe unique identifier of this request.outputobjectThe data returned by the model.
Properties voice_list array[object]The list of queried voices.
Properties voice_id stringThe voice ID. Use it in the voice parameter of the TTS API.gmt_createstringThe creation time.gmt_modifiedstringThe last modification time.statusstringThe voice status. For valid values, see "Voice status descriptions".objectUsage information for this request.
Properties count integerAlways 1. |
Query voice details
Request bodymodelstring(required)Set to voice-enrollment (Qwen-Audio-TTS/CosyVoice).inputobject(required)The input parameters.
Properties action string(required)Set to query_voice.voice_id string(required)The voice ID to query. | This example uses the Beijing region endpoint. For the Singapore region, use: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/tts/customization.Replace {WorkspaceId} with your actual workspace ID.
|
Response bodyrequest_idstringThe unique identifier of this request.outputobjectThe data returned by the model.
Properties resource_link stringThe URL of the audio file.gmt_createstringThe creation time.gmt_modifiedstringThe last modification time.statusstringThe voice status. For valid values, see "Voice status descriptions".target_modelstringThe TTS model that drives the cloned voice.objectUsage information for this request.
Properties count integerAlways 1. |
Update a voice
Request bodymodelstring(required)Set to voice-enrollment.inputobject(required)The input parameters.
Properties action string(required)Set to update_voice.voice_id string(required)The voice ID to update.url string(required)The URL of the new audio file. The URL must be publicly accessible. | This example uses the Beijing region endpoint. For the Singapore region, use: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/tts/customization. |
Response bodyrequest_idstringThe unique identifier of this request.outputobjectThe data returned by the model. The update operation returns no business data. The response may include a preview_audio field, which is an empty object that you can ignore.usageobjectUsage information for this request.
Properties count integerAlways 1. |
Delete a voice
Request bodymodelstring(required)The voice cloning model. Valid values:
object(required)The input parameters.
Properties action string(required)Set to delete_voice.voice_id string(required)The voice ID to delete. | This example uses the Beijing region endpoint. For the Singapore region, use: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/tts/customization.Replace {WorkspaceId} with your actual workspace ID. |
Response bodyrequest_idstringThe unique identifier of this request.outputobjectThe data returned by the model. This is an empty object.usageobjectUsage information for this request.
Properties count integerAlways 1. |
Voice status descriptions
Created voices go through a review process. The following statuses apply to Qwen-Audio-TTS/CosyVoice when model is voice-enrollment.
Status | Description |
|---|---|
DEPLOYING | Under review or processing. |
OK | Review passed. The voice is ready to use. |
UNDEPLOYED | Review rejected. The voice can't be used. |