Use the HTTP API to create, list, query, update, and delete cloned voices.
Service endpoint
- Singapore
- China (Beijing)
POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/tts/customizationReplace {WorkspaceId} with your actual workspace ID.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
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(conditionally required)The URL of the audio file for voice cloning. The URL must be publicly accessible.audio object(conditionally required)The audio data. Two submission methods are supported:
string(optional)The transcript of the audio, used to improve cloning quality.prefix string(conditionally 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}.preferred_name string(conditionally required)A prefix for the voice name. Only alphanumeric characters and underscores are allowed, with a maximum length of 16 characters.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:
string(optional)The language of the audio provided in audio.data. If you use this parameter, make sure the specified language matches the actual language of the audio used for cloning.Valid values:
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 Singapore region endpoint. For the Beijing region, use: https://{WorkspaceId}.cn-beijing.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 / voice stringThe voice ID. Qwen-Audio-TTS/CosyVoice returns voice_id, while Qwen returns voice. Use this value directly in the voice parameter of the TTS API.target_modelstringThe TTS model that drives the cloned voice.fallback_modebooleanWhether the voice was created in fallback mode. A value of true indicates that the audio quality was poor or didn't match the provided text, and the cloning quality may be reduced.fallback_reasonstringThe reason for the fallback. Possible values include no_merged_segments (unable to merge audio segments) and no_valid_asr_segments (severe mismatch between audio and text).objectUsage information for this request.
Properties count integerThe number of voices created. Always 1. |
Query voice list
Request bodymodelstring(required)The voice cloning model. Valid values:
object(required)The input parameters.
Properties action string(required)The action type. Qwen-Audio-TTS/CosyVoice: list_voice. Qwen: list.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 Singapore region endpoint. For the Beijing region, use: https://{WorkspaceId}.cn-beijing.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 page_index integerThe current page index.page_sizeintegerThe number of entries per page.total_countintegerThe total number of voices.voice_listarray[object]The list of queried voices. Both Qwen-Audio-TTS/CosyVoice and Qwen use the voice_list field name.
Properties voice_id / voice stringThe voice ID. Qwen-Audio-TTS/CosyVoice uses voice_id, while Qwen uses voice.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 for Qwen-Audio-TTS/CosyVoice. Always 0 for Qwen. |
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 Singapore region endpoint. For the Beijing region, use: https://{WorkspaceId}.cn-beijing.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 Singapore region endpoint. For the Beijing region, use: https://{WorkspaceId}.cn-beijing.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)The action type. Qwen-Audio-TTS/CosyVoice: delete_voice. Qwen: delete.voice_id string(conditionally required)The voice ID to delete.voice string(conditionally required)The voice name to delete. | This example uses the Singapore region endpoint. For the Beijing region, use: https://{WorkspaceId}.cn-beijing.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. Qwen-Audio-TTS/CosyVoice returns an empty object, while Qwen returns the name of the deleted voice.
Properties voice stringThe name of the deleted voice.objectUsage information for this request.
Properties count integerAlways 1 for Qwen-Audio-TTS/CosyVoice. Always 0 for Qwen. |
Voice status descriptions
After a voice is created, it goes through a review process. The statuses below apply only to Qwen-Audio-TTS/CosyVoice (when model is voice-enrollment). Qwen query and list responses don't include a status field.
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. |