Skip to main content
POST
Text to speech

Body

application/json

Request body for text-to-speech conversion.

input
string
required

Text to convert into speech. Required.

voice
string | null

Preset speaker name. Qwen3-TTS CustomVoice includes vivian, ryan, aiden, and others. Omit this for voice cloning.

task_type
enum<string> | null

Qwen3-TTS task. CustomVoice uses a preset speaker. VoiceDesign follows instructions. Base clones a voice from ref_audio and ref_text. Other speech models ignore this.

Available options:
CustomVoice,
VoiceDesign,
Base
instructions
string | null

Style or emotion text. Required for Qwen3-TTS VoiceDesign. Optional style control on CustomVoice.

ref_audio

Reference audio for voice cloning. A URL, a base64 data URL, or a list of those. Required for clone-only models and for Qwen3-TTS Base. CustomVoice and VoiceDesign checkpoints reject it.

ref_text
string | null

Transcript of ref_audio. Required for in-context voice cloning unless x_vector_only_mode is true.

x_vector_only_mode
boolean | null

Clone from the speaker embedding in ref_audio only. When true, ref_text is not required.

language
string | null

Language of the spoken text, such as English or Chinese. Optional.

sample_rate
integer | null

Output sample rate in hertz, when the model accepts one.

max_new_tokens
integer | null

Maximum number of generated speech tokens.

Required range: x >= 1
stream
boolean
default:false

Stream the audio response.

response_format
enum<string>
default:mp3

Desired audio format for the returned speech.

Available options:
mp3,
wav,
opus,
flac,
pcm
speed
number
default:1

Playback speed multiplier for the generated speech (1.0 = normal).

stream_format
enum<string>
default:audio

Whether the response will be streamed as SSE or returned as raw audio.

Available options:
sse,
audio

Response

Audio bytes in requested response_format

The response is of type file.