Use the Voice Design HTTP API to create, list, query, and delete custom voices.
User guide: Voice Design.
Created voices go through a review process. The following statuses apply to Qwen-Audio-TTS/CosyVoice when
Endpoint
- China (Beijing)
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/audio/tts/customizationReplace {WorkspaceId} with your actual workspace ID.Request headers
Parameter | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Set to |
Content-Type | string | Yes | Media type of the request body. Set to |
Create a voice
Request bodymodelstring(Required)The voice design model. Valid values:
object(Required)The input parameter object.
Properties action string(Required)The operation type.
string(Required)The text-to-speech (TTS) model for the voice. Must match the model in TTS API calls, or synthesis fails.voice_prompt string(Required)Description of desired voice characteristics. Chinese and English only.
string(Required)The text for the preview audio.
string(Required)Voice name prefix. Alphanumeric only, max 10 characters. Generated name format: {target_model}-vd-{prefix}-{unique_id}language_hints array[string](Optional)The language tendency of the generated voice, which affects the language characteristics and pronunciation tendencies of the voice. We recommend selecting the corresponding language code based on your actual usage scenario. If you use this parameter, the language must match the language of preview_text.This parameter is an array, but the current version only processes the first element.Valid values:
object(Optional)Configuration for voice design.
Properties sample_rate int(Optional)Sample rate of the preview audio, in Hz.
string(Optional)Format of the preview audio.
| The following examples use the China (Beijing) region configuration. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region. |
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.preview_audioobjectThe preview audio data.
Properties data stringThe preview audio data, Base64-encoded.sample_rate intThe sample rate of the preview audio, in Hz.response_format stringThe format of the preview audio.stringThe TTS model that drives the voice.objectUsage information for this request.
Properties count integerThe number of voices created. Always 1. |
List voices
Request bodymodelstring(Required)The voice design model. Valid values:
object(Required)The input parameter object.
Properties action string(Required)Set to list_voice.prefix string(Optional)Filter voices by name prefix.page_index integer(Optional)The page index.page_size integer(Optional)The number of entries per page. | The following examples use the China (Beijing) region configuration. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region. |
Response bodyrequest_idstringThe unique identifier of this request.outputobjectThe data returned by the model.
Properties voice_list array[object]The list of voices returned by the query.
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 reference".voice_promptstringThe voice description text.preview_textstringThe preview audio text.objectUsage information for this request.
Properties count integerAlways 1. |
Query voice details
Request bodymodelstring(Required)The voice design model. Valid values:
object(Required)The input parameter object.
Properties action string(Required)Set to query_voice.voice_id string(Required)The voice ID to query. | The following examples use the China (Beijing) region configuration. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region. |
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.gmt_createstringThe creation time.gmt_modifiedstringThe last modification time.statusstringThe voice status. For valid values, see "Voice status reference".target_modelstringThe TTS model that drives the voice.voice_promptstringThe voice description text.preview_textstringThe preview audio text.objectUsage information for this request.
Properties count integerAlways 1. |
Delete a voice
Request bodymodelstring(Required)The voice design model. Valid values:
object(Required)The input parameter object.
Properties action string(Required)Set to delete_voice.voice_id string(Required)The voice ID to delete. | The following examples use the China (Beijing) region configuration. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region. |
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 reference
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 for use. |
UNDEPLOYED | Review rejected. The voice can't be used. |