Create, query, update, and delete Qwen-Audio and CosyVoice voices.
This document applies to Qwen-Audio-TTS, Qwen-Audio-Realtime, and CosyVoice.
First obtain an API Key and configure environment variables. The request examples read
Replace
The authentication token, in the format Fixed to
For reference audio requirements, see the Voice Cloning User Guide. For the Qwen-Audio-Realtime cloning workflow, see Realtime Voice Chat voice cloning. Creating voices for Qwen-Audio-Realtime is free; model calls are billed according to the target model. For details, see Billing Details, and for quantity limits, see Quota description.
Fixed to
Operation type:The target model that will use the voice later. It must be consistent with the model used in subsequent calls; otherwise, the call fails.The target model can be a Qwen-Audio-TTS, Qwen-Audio-Realtime, or CosyVoice model that supports Voice Cloning. For the specific models and regions, see Supported models.Provide the reference audio when creating, or the new reference audio when updating. Supports a publicly accessible URL or a Base64 Data URI, such as When creating: the prefix of the voice name. Only digits and English letters are allowed, up to 10 characters. The generated voice name format: Helps the model identify the language of the sample audio, so it can extract voice features more accurately and improve the cloning quality. If the specified language does not match the actual audio language (for example, setting
Default value: ["zh"].The maximum duration (in seconds) of the reference audio used for Voice Cloning after audio preprocessing. Value range: [3.0, 30.0].Default value: 10.0.Whether to enable audio preprocessing (noise reduction, audio enhancement, and volume leveling). We recommend enabling it when there is background noise, and disabling it in quiet environments to preserve the voice as much as possible.Default value: false.Whether to normalize the volume of the sample audio used for Voice Cloning. Values:Page index.Number of records per page.The ID of the voice to query, update, or delete.
The unique identifier of this call.Returns the corresponding fields when creating, querying the list, or querying details; returns an empty object when updating or deleting.
Voice ID.The list of queried voices.
Voice ID.The target model that drives the voice (speech synthesis or realtime voice chat).Created At.Updated At.Voice status. For valid values, see "Voice status description".The URL address of the audio file.Created At.Updated At.Voice status. For valid values, see "Voice status description".The target model that drives the voice (speech synthesis or realtime voice chat).Usage information for this request.
Fixed at 1. When creating a voice, it indicates the number of voices created.
After a voice is created, it goes through a review process.
If you encounter errors, see Error codes for troubleshooting.
DASHSCOPE_API_KEY. When using different APIs to manage the same voice, use the same account.
For SDK definitions, see also Java SDK and Python SDK.
API Endpoint
- China (Beijing)
- Singapore
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/tts/customization{WorkspaceId} with your actual Workspace ID, which you can view on the Workspace Details page in the Bailian console. API Keys differ between Beijing and Singapore.
Request Headers
AuthorizationstringRequired: YesBearer <your_api_key>. When using it, replace "<your_api_key>" with your actual API Key.Content-TypestringRequired: Yesapplication/json.Audio Requirements and Billing
For reference audio requirements, see the Voice Cloning User Guide. For the Qwen-Audio-Realtime cloning workflow, see Realtime Voice Chat voice cloning. Creating voices for Qwen-Audio-Realtime is free; model calls are billed according to the target model. For details, see Billing Details, and for quantity limits, see Quota description.
Request Body
modelstring(Required)voice-enrollment.inputobject(Required)Property
Property
actionstring(required)create_voice: Create a voice.list_voice: Query the voice list.query_voice: Query voice details.update_voice: Update a voice.delete_voice: Delete a voice.
target_modelstring(required when creating)audiostring(required when creating or updating if url is not specified)data:audio/wav;base64,....Compatible with the legacy parameter
url; when using url, you can omit audio. url will be gradually deprecated; we recommend switching to audio.prefixstring(Required when creating, optional when querying the list){target_model}-{prefix}-{unique identifier}.When listing: filters voices by prefix.language_hintsarray[string](optional when creating)en for Chinese audio), the system ignores this setting and automatically detects the language.This parameter is an array, and its length must be 1.Applies 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_lengthfloat(optional when creating)Applies 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_preprocessboolean(optional when creating)Applies 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(optional when creating)"true": Enable volume normalization."false": Disable volume normalization.
"false".page_indexinteger(Optional when querying the list)page_sizeinteger(Optional when querying the list)voice_idstring(Required when querying details, updating, or deleting)Request example
- Create
- Query list
- Query details
- Update
- Delete
The example uses When using a local WAV audio file, you can generate a Base64 Data URI with the following code and fill the value of
qwen-audio-3.1-tts-plus. Replace target_model in input with your actual target model ID.The following is the configuration for the Singapore region. Replace "{WorkspaceId}" with your actual workspace ID when calling. Configurations differ across regions.audio into 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_idstringoutputobjectProperty
Property
voice_idstringvoice_listarray[object]Property
Property
voice_idstringtarget_modelstringgmt_createstringgmt_modifiedstringstatusstringresource_linkstringgmt_createstringgmt_modifiedstringstatusstringtarget_modelstringusageobjectProperty
Property
countintegerResponse Example
- Create
- Query list
- Query details
- Update
- Delete
Voice Status
After a voice is created, it goes through a review process.
| Status | Description |
|---|---|
| DEPLOYING | In Review/Processing. |
| OK | The review is passed, and the voice can be used normally. |
| UNDEPLOYED | The review is not passed, and the voice cannot be used. |