Overview
Qwen Voice-Design model is a series of voice design models from Qwen Speech Model. It only requires a simple text description to quickly design a suitable voice. When used in conjunction with the qwen3-tts-vd-realtime model, it can design and output speech in 10 languages. Furthermore, the synthesized audio can adaptively adjust its tone based on the text and has good processing capabilities for complex text synthesis.
Input
Text
Output
Audio
Features
Prefix Completion
Enable Partial Mode when calling the Qwen API to make the model continue strictly from your provided prefix text.View docsFunction Calling
Use function calling to connect large language models with external tools and systems.View docsCache
Context Cache stores shared prefixes for long-context requests to reduce repeated computation, improve latency, and lower cost.View docsStructured Outputs
Structured Outputs help ensure the model returns a JSON string in the expected format.View docsPricing
- Voice Enrollment And Design$0.2Per voice
Rate Limits
- RPMRequests Per Minute180
API Reference
Call APICopy success!
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
import requests
import base64
import os
def create_voice_and_play():
api_key = os.getenv("DASHSCOPE_API_KEY")
if not api_key:
print("Error: The DASHSCOPE_API_KEY environment variable was not found. Please set the API Key first")
return None, None, None
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
data = {
"model": "qwen-voice-design",
"input": {
"action": "create",
"target_model": "qwen3-tts-vd-realtime-2025-12-16",
"voice_prompt": "A composed middle-aged male announcer with a deep, rich and magnetic voice, a steady speaking speed and clear articulation, is suitable for news broadcasting or documentary commentary.",
"preview_text": "Dear listeners, hello everyone. Welcome to the evening news.",
"preferred_name": "announcer",
"language": "en"
},
"parameters": {
"sample_rate": 24000,
"response_format": "wav"
}
}
url = "https://maas.qwencloudapi.com/api/v1/services/audio/tts/customization"
try:
response = requests.post(
url,
headers=headers,
json=data,
timeout=60
)
if response.status_code == 200:
result = response.json()
voice_name = result["output"]["voice"]
print(f"voice name: {voice_name}")
base64_audio = result["output"]["preview_audio"]["data"]
audio_bytes = base64.b64decode(base64_audio)
filename = f"{voice_name}_preview.wav"
with open(filename, 'wb') as f:
f.write(audio_bytes)
print(f"The audio has been saved to a local file: {filename}")
print(f"File path: {os.path.abspath(filename)}")
return voice_name, audio_bytes, filename
else:
print(f"Request failed. Status code: {response.status_code}")
print(f"Response: {response.text}")
return None, None, None
except requests.exceptions.RequestException as e:
print(f"Net error: {e}")
return None, None, None
except KeyError as e:
print(f"The response data format is incorrect and necessary fields are missing: {e}")
print(f"Response: {response.text if 'response' in locals() else 'No response'}")
return None, None, None
except Exception as e:
print(f"An unknown error occurred: {e}")
return None, None, None
if __name__ == "__main__":
voice_name, audio_data, saved_filename = create_voice_and_play()
if voice_name:
print(f"\nThe voice was successfully created '{voice_name}'")
print(f"The audio file has been saved: '{saved_filename}'")
print(f"File size: {os.path.getsize(saved_filename)} ")
else:
print("\nThe voice creation failed")