Home Blog

How to Use the Qwen Audio 3.1 Realtime Flash API

Qwen Audio 3.1 Realtime Flash API blog cover

Nov 3, 2026

EmpirioLabs AI

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

Qwen Audio 3.1 Realtime Flash is available on EmpirioLabs. It is the fast tier of Alibaba's Qwen Audio 3.1 voice conversation models: you open a WebSocket, stream microphone audio up, and the spoken reply streams back. It has 88 voices, separate settings for the language you speak and the language it answers in, turn detection that tells a pause from the end of a sentence, and native web search that runs in the same session as your own function calls.

Try it in the Playground: click Start session and talk.

Watch the launch film

Every voice in the film is a real Qwen Audio 3.1 Realtime Flash reply over the socket, each answering a typed question: Luca in English, Yuxiaoyun in Mandarin, and Emily in Japanese. The pictures are Qwen Image 2.1 outputs, and the score was generated by ACE-Step on EmpirioLabs. Watch it on YouTube.

Connecting

Open the realtime endpoint with the model in the query string and your API key on the handshake:

wss://api.empiriolabs.ai/v1/realtime?model=qwen-audio-3-1-realtime-flash
Authorization: Bearer YOUR_EMPIRIOLABS_API_KEY

Configure the session with session.update, append microphone audio as input_audio_buffer.append, and read the reply from response.audio.delta, with its transcript on response.audio_transcript.delta. Audio travels as 16-bit PCM, 16 kHz going up and 24 kHz coming back.

{"type": "session.update", "session": {
    "voice": "xunanchuan_v3.1",
    "instructions": "You are a concise travel assistant. Answer in English.",
    "input_language": "en",
    "output_language": "en",
    "turn_detection": {"type": "smart_turn_v2"}
}}

Voices, languages, and delivery

  • Voices. 88 voices, listed on the voice parameter in the API reference and in the Playground picker. Leave voice unset and longanqian_v3.1 speaks.
  • Languages. input_language is the language you speak, which your transcript is written in, and output_language the language the reply is read in. Each takes auto or one of 14 codes: zh, en, ja, ko, vi, th, id, ar, fr, de, es, pt, ru, and it.
  • Delivery. speed (0.5 to 2) sets the speaking rate, enable_speech_emotion the expressive delivery, and max_history_turns (1 to 50) how many earlier exchanges the model reads.

Turn detection

server_vad, the default, ends your turn after a pause of silence_duration_ms. smart_turn also judges what was said, so filler sounds such as "um" do not end a turn or interrupt the reply, and smart_turn_v2 also answers bystanders and side remarks less often. Set turn_detection to null to commit turns yourself.

Web search with your own functions

Web search is off by default. Turn it on with enable_search, and declare functions in tools in the same session: the model can look something up and call your function within one conversation.

{"type": "session.update", "session": {
    "enable_search": true,
    "tools": [{
        "type": "function",
        "name": "book_table",
        "description": "Book a restaurant table",
        "parameters": {"type": "object", "properties": {
            "restaurant": {"type": "string"}, "time": {"type": "string"}},
            "required": ["restaurant", "time"]}
    }]
}}

Operational notes

  • Choose the voice before the first turn. Once the session has started processing audio, a session.update with a different voice is refused with an error event. Open a new session to switch voices.
  • The output language does not translate. It sets the language the reply is read in. Ask for that language in instructions too.
  • Keep streaming briefly after the speech ends. Turn detection ends a turn by hearing the speaker stop, so a client that cuts the audio at the last word gets no reply. Send about a second of silence after it.

Pricing

Each completed turn is billed from the usage the model reports, with separate rates for audio and text tokens in both directions, so a text-only reply, with audio dropped from modalities, costs less than a spoken one. Search results are added to the conversation and count as input tokens. Realtime Flash is priced well below Qwen Audio 3.1 Realtime Plus. Current rates are on the model page and the pricing page.

Start building

Try Qwen Audio 3.1 Realtime Flash in the Playground, read the API documentation, and find the full event tables in the Realtime Voice API guide.

Ready to use better endpoints?

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