HTTP parameters, responses, and examples for cloning and managing Qwen-Audio and CosyVoice voices.
This reference covers Qwen-Audio-TTS, Qwen-Audio-Realtime, and CosyVoice.
First Obtain API Key and Configure Environment Variables. Request examples read from
Replace
Authentication token in the format Set to
Refer to the Voice Cloning User Guide for audio requirements. The cloning process for Qwen-Audio-Realtime is described in Real-time voice conversation Voice Cloning. Creating a voice with Qwen-Audio-Realtime is free; model invocation is billed according to the target model, details in Billing Information, and quantity limits are outlined in Quota Information.
— RequiredSet to — Required
— RequiredOperation:— Required for creationThe model that will use the voice. It must match the model used in subsequent synthesis or conversation calls; otherwise, the call fails.Choose a Qwen-Audio-TTS, Qwen-Audio-Realtime, or CosyVoice model that supports voice cloning. See Supported models for model IDs and regions.— Required for creation or update when — Required for creation; optional when listing voicesFor creation: Voice name prefix. Allowed characters are digits and English letters, up to 10 characters. The generated voice name has the format — Optional for creationAuxiliary model to identify the language of the sample audio, enabling more accurate extraction of voice characteristics and improving cloning performance. If the specified language does not match the actual audio language (e.g., setting
Default value: ["zh"].— Optional for creationMaximum duration (in seconds) of the reference audio used for voice cloning after preprocessing. Value range: [3.0, 30.0].Default value: 10.0.— Optional for creationWhether 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.— Optional for creationWhether to normalize the volume of the sample audio used for voice cloning. Values:— Optional when listing voicesThe page index.— Optional when listing voicesThe number of entries per page.— Required to get, update, or delete a voiceThe ID of the voice to get, update, or delete.
The unique identifier of this request.Contains the fields for creation, listing, or getting voice details. An empty object is returned for update or deletion.
— Returned for creationVoice ID.— Returned when listing voicesList of voices found.
Voice ID.The target model driving the voice (text-to-speech or real-time speech conversation).The time when the voice was created.The last modification time.Voice status; see "Voice Status Description" for valid values.— Returned for voice detailsThe URL of the audio file.— Returned for voice detailsThe time when the voice was created.— Returned for voice detailsThe last modification time.— Returned for voice detailsVoice status; see "Voice Status Description" for valid values.— Returned for voice detailsThe target model driving the voice (text-to-speech or real-time speech conversation).Usage information for this request.
Always 1. For voice creation, this is the number of voices created.
Created voices go through a review process.
If you encounter any errors, please refer to Error Codes for troubleshooting.
The former MiniMax voice cloning reference has moved to MiniMax HTTP API.
DASHSCOPE_API_KEY. When managing the same voice across different APIs, use the same account.
For SDK definitions, see Java SDK and Python SDK.
Service endpoint
- China (Beijing)
- Singapore
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/tts/customization{WorkspaceId} with the actual Workspace ID; this can be found on the Workspace Details page in the Alibaba Cloud Model Studio console. The API Keys for Beijing and Singapore differ.
Request headers
AuthorizationstringRequired: YesBearer <your_api_key>. Replace <your_api_key> with your actual API key.Content-TypestringRequired: Yesapplication/json.Audio Requirements and Costs
Refer to the Voice Cloning User Guide for audio requirements. The cloning process for Qwen-Audio-Realtime is described in Real-time voice conversation Voice Cloning. Creating a voice with Qwen-Audio-Realtime is free; model invocation is billed according to the target model, details in Billing Information, and quantity limits are outlined in Quota Information.
Request body
modelstringvoice-enrollment.inputobjectProperties
Properties
actionstringcreate_voice: Create a voice.list_voice: List voices.query_voice: Get voice details.update_voice: Update a voice.delete_voice: Delete a voice.
target_modelstringaudiostringurl is not providedReference audio for creation, or new reference audio for an update. Accepts a publicly accessible URL or a Base64 Data URI, such as data:audio/wav;base64,....Compatible with the legacy parameter
url; when using url, audio may be omitted. url will be phased out; it is recommended to switch to audio.prefixstring{target_model}-{prefix}-{unique_identifier}.When listing voices: Filters voices by name prefix.language_hintsarray[string]en for Chinese audio), the system will ignore this setting and automatically detect the language.This parameter is an array, and its length must be 1.Applicable to qwen-audio-3.1-tts-plus, qwen-audio-3.1-tts-flash, qwen-audio-3.0-tts-plus, qwen-audio-3.0-tts-flash, qwen-audio-3.1-realtime-plus, qwen-audio-3.1-realtime-flash, qwen-audio-3.0-realtime-plus, qwen-audio-3.0-realtime-flash, cosyvoice-v3.5-plus, cosyvoice-v3.5-flash, cosyvoice-v3-plus, cosyvoice-v3-flash.
Click to view the languages supported by each model
Click to view the languages supported by each model
-
qwen-audio-3.1-tts-plus、qwen-audio-3.1-tts-flash、qwen-audio-3.0-tts-plus、qwen-audio-3.0-tts-flash、qwen-audio-3.1-realtime-plus、qwen-audio-3.1-realtime-flash、qwen-audio-3.0-realtime-plus、qwen-audio-3.0-realtime-flash:
- zh: Chinese
- en: English
- fr: French
- de: German
- ja: Japanese
- ko: Korean
- ru: Russian
- pt: Portuguese
- th: Thai
- id: Indonesian
- vi: Vietnamese
- it: Italian
- es: Spanish
- ms: Malay
- fil: Filipino
- ar: Arabic
-
cosyvoice-v3-plus:
- zh: Chinese
- en: English
- fr: French
- de: German
- ja: Japanese
- ko: Korean
- ru: Russian
-
cosyvoice-v3.5-plus、cosyvoice-v3.5-flash、cosyvoice-v3-flash:
- zh: Chinese
- en: English
- fr: French
- de: German
- ja: Japanese
- ko: Korean
- ru: Russian
- pt: Portuguese
- th: Thai
- id: Indonesian
- vi: Vietnamese
max_prompt_audio_lengthfloatApplies to qwen-audio-3.1-tts-plus, qwen-audio-3.1-tts-flash, qwen-audio-3.0-tts-plus, qwen-audio-3.0-tts-flash, qwen-audio-3.1-realtime-plus, qwen-audio-3.1-realtime-flash, qwen-audio-3.0-realtime-plus, qwen-audio-3.0-realtime-flash, cosyvoice-v3.5-plus, cosyvoice-v3.5-flash, cosyvoice-v3-flash.
enable_preprocessbooleanApplies to qwen-audio-3.1-tts-plus, qwen-audio-3.1-tts-flash, qwen-audio-3.0-tts-plus, qwen-audio-3.0-tts-flash, qwen-audio-3.1-realtime-plus, qwen-audio-3.1-realtime-flash, qwen-audio-3.0-realtime-plus, qwen-audio-3.0-realtime-flash, cosyvoice-v3.5-plus, cosyvoice-v3.5-flash, cosyvoice-v3-flash.
enable_volume_normalizationstring"true": Enable volume normalization."false": Disable volume normalization.
"false".page_indexintegerpage_sizeintegervoice_idstringRequest examples
- Create
- List
- Get details
- Update
- Delete
The example uses When using a local WAV audio file, you can generate a Base64 Data URI using the following code and set the value of
qwen-audio-3.1-tts-plus. Replace target_model in input with your actual target model ID.The following configuration is for the China (Beijing) region. Replace "{WorkspaceId}" with your actual workspace ID. The configuration varies by region.audio in the audio field of the input object in the create or update request. Replace sample.wav with the path to your local audio file.Response body
request_idstringoutputobjectProperties
Properties
voice_idstringvoice_listarray[object]Properties
Properties
voice_idstringtarget_modelstringgmt_createstringgmt_modifiedstringstatusstringresource_linkstringgmt_createstringgmt_modifiedstringstatusstringtarget_modelstringusageobjectProperties
Properties
countintegerResponse examples
- Create
- List
- Get details
- Update
- Delete
Voice status descriptions
Created voices go through a review process.
| 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. |