Home Blog

How to Use the Qwen Audio 3.1 TTS API

Qwen Audio 3.1 TTS API blog cover

Oct 18, 2026

EmpirioLabs AI

Disclosure: This article was written with AI assistance and reviewed by EmpirioLabs AI.

Qwen Audio 3.1 TTS is available on EmpirioLabs. It is Alibaba's real-time speech synthesis model, with 19 voices, delivery you direct in plain language, and inline tags that change emotion or add a sound mid-sentence. It returns a finished audio file through POST /v1/audio/speech or streams audio as it is generated through POST /v1/audio/speech:stream, in the API and in the Playground, and over the Realtime API it speaks text while the text is still being written.

Watch the launch film

Every voice in the film is a real Qwen Audio 3.1 TTS output: Brian directed in plain language as a trailer narrator, then Cindy, Ava, and Andy with excited, whisper, and laughing tags. The pictures are Qwen Image 2.1 outputs, and the score was generated by ACE-Step on EmpirioLabs. Watch it on YouTube.

Voices and languages

English voices. Fifteen voices speak English. Emily, Luna, Eric, and Luca have British accents. Abby, Annie, Ava, Beth, Betty, Cally, Cindy, Donna, Andy, Brian, and David have American accents.

Multilingual voices. longanhuan_v3.1, longanlingxin_v3.1, longanfengyue_v3.1, and xunanchuan_v3.1 read Chinese, English, and other languages.

Language hints. For text that mixes languages, language_hints takes an array of language codes, such as ["en", "zh"], to guide pronunciation. Sixteen codes are supported, including en, zh, ja, ko, fr, de, es, and ar.

Your first request

curl https://api.empiriolabs.ai/v1/audio/speech \
  -H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-audio-3-1-tts",
    "input": "[excited]We hit our launch date![laughing] Thank you all for the late nights.",
    "voice": "Ava_v3.1",
    "instruction": "Warm and upbeat, like a team lead sharing good news",
    "response_format": "mp3",
    "sample_rate": 24000
  }'

The response carries a URL to the generated audio. Output is MP3, WAV, PCM, or Opus at 8,000 to 48,000 Hz. speed, pitch, volume, and seed are adjustable, pronunciation and replace fix names, acronyms, and brand names, and enable_markdown_filter keeps formatting characters from being read aloud.

Directing the delivery

  • Instruction. instruction sets emotion, tone, character, pace, and speaking style for the whole passage, up to 1,000 characters.
  • Delivery tags. A tag such as [excited], [whispers], [serious], or [very slowly] changes the delivery from the point where it appears.
  • Sound tags. A tag such as [laughing], [sighing], [gasp], or [clears throat] adds a one-time sound. The full list of tags is on the input parameter in the API reference.

Streaming

POST /v1/audio/speech:stream takes the same body and returns Server-Sent Events. Each audio.chunk event carries a base64 audio chunk in audio_b64, in the requested format and sample rate. A final audio.done event carries the URL of the complete file, its duration, and the usage, followed by [DONE].

Realtime: speak text while it is written

Over the Realtime API, Qwen Audio 3.1 TTS speaks text while the text is still arriving, for example a language model's reply as it streams. Open a WebSocket to wss://api.empiriolabs.ai/v1/realtime?model=qwen-audio-3-1-tts with your API key in the Authorization header, send text with input_text_buffer.append in pieces of any size, and play the audio from each response.audio.delta event.

{"type": "session.update", "session": {"voice": "Ava_v3.1", "instruction": "Warm, like a late-night radio host"}}
{"type": "input_text_buffer.append", "text": "Good evening, "}
{"type": "input_text_buffer.append", "text": "and welcome to the late edition."}
{"type": "session.finish"}
  • Sending text. input_text_buffer.commit speaks everything sent so far. session.finish speaks the rest and ends the session with session.finished.
  • Audio and settings. Audio is 16-bit PCM at 24,000 Hz by default. session.update sets the voice, instruction, format (pcm, mp3, or opus), sample rate, and the other speech settings, starting with the next segment.
  • Segments. Text is spoken in segments that end at sentence boundaries, and each segment closes with a response.done event that carries its usage. A segment also ends after 8 seconds without new text.
  • Web pages. A browser connects with a short-lived client secret from POST /v1/realtime/client_secrets, so your API key stays on your server.

The Realtime guide has a complete Python client and the event reference.

Operational notes

  • Every voice id ends in _v3.1. A bare name such as Emily, or a Qwen Audio 3.0 TTS voice id, is rejected with the list of the 19 valid ids. Use Emily_v3.1.
  • SSML is not supported. Send plain text. Use instruction for the overall delivery and inline tags for changes within the text.
  • Up to 10,000 characters per request. Split longer scripts across several requests.

Pricing

Token billing. Qwen Audio 3.0 TTS bills per character; Qwen Audio 3.1 TTS bills tokens. The text you send is billed as input tokens, and the generated audio as output tokens at 12.5 tokens per second of audio, and a realtime session bills each segment the same way. The speed and pitch settings change the length of the audio but not the billed tokens, while an instruction that slows the delivery adds output tokens. Current rates are on the model page and the pricing page.

Start building

Try Qwen Audio 3.1 TTS in the Playground, where the voice picker and every parameter are live controls, and read the API documentation for the full parameter reference.

Ready to use better endpoints?

Explore our models, or contact us about business inquiries, custom deployments, or anything else.