Qwen Audio 3.1 Realtime Flash API

Duplex speech conversation over one socket, with 88 voices, native web search that works alongside tool calling, and separate text and audio token rates.

Alibaba Cloud Audio Generation 240K context Released Oct 27, 2026 Singapore Proprietary Endpoint New

About Qwen Audio 3.1 Realtime Flash

Duplex speech conversation over one socket, with 88 voices, native web search that works alongside tool calling, and separate text and audio token rates.

Session is configured with session.update events over the socket rather than request parameters. Web search is off by default and works alongside function calling. Text and audio tokens bill at separate rates, and a spoken reply bills its audio tokens only.

Also known as Qwen Audio Realtime Flash, Alibaba Cloud Qwen Audio 3.1 Realtime Flash

realtime speech to speech audio in audio out function calling web search multilingual

Qwen Audio 3.1 Realtime Flash specs

Model ID
qwen-audio-3-1-realtime-flash
Author
Alibaba Cloud
Category
Audio Generation
Released
Oct 27, 2026
Context window
240K tokens
Max output
16,384 tokens
Input
AudioText
Output
AudioText
Region
Singapore
Endpoints
WEBSOCKET/v1/realtime
Alternate model IDs
qwen-audio-3.1-realtime-flashalibaba/qwen-audio-3-1-realtime-flash

Qwen Audio 3.1 Realtime Flash API pricing

Live pay-as-you-go rates from the EmpirioLabs catalog. You are billed only for what you use, with no monthly minimum.

Type
Spec
Rate
Input: audio
per 1M audio input tokens
$1.86
Input
per 1M prompt tokens
$0.46
Output
per 1M generated tokens, text-only replies
$1.40
Output: audio
per 1M generated audio tokens
$3.74
Web search
per call when invoked
$0.00
Compare on the full pricing page

How to call the Qwen Audio 3.1 Realtime Flash API

Qwen Audio 3.1 Realtime Flash holds a live conversation over a WebSocket at wss://api.empiriolabs.ai/v1/realtime?model=qwen-audio-3-1-realtime-flash, not over the HTTP endpoints. Connect with the model id qwen-audio-3-1-realtime-flash and send your EmpirioLabs API key as an Authorization: Bearer header on the handshake. Audio travels both ways as base64 16-bit PCM. A browser cannot set headers on a WebSocket, so open this connection from your server and relay audio to the browser over your own socket. Get an API key from the EmpirioLabs dashboard.

Python (websockets)
import asyncio, json, os, websockets

async def main():
    async with websockets.connect(
        "wss://api.empiriolabs.ai/v1/realtime?model=qwen-audio-3-1-realtime-flash",
        additional_headers=[
            ("Authorization", f"Bearer {os.environ['EMPIRIOLABS_API_KEY']}"),
        ],
        max_size=None,
    ) as ws:
        print(json.loads(await ws.recv())["type"])  # session.created

        await ws.send(json.dumps({
            "type": "conversation.item.create",
            "item": {
                "type": "message",
                "role": "user",
                "content": [{"type": "input_text", "text": "Say hello."}],
            },
        }))
        await ws.send(json.dumps({"type": "response.create"}))

        async for raw in ws:
            event = json.loads(raw)
            if event["type"] == "response.audio.delta":
                ...  # base64 audio chunk, append to your playback buffer
            elif event["type"] == "response.done":
                break

asyncio.run(main())
Full Qwen Audio 3.1 Realtime Flash API reference

Qwen Audio 3.1 Realtime Flash API parameters

Request parameters supported by the Qwen Audio 3.1 Realtime Flash API on EmpirioLabs. Defaults apply when a field is omitted.

ParameterTypeDefaultRange / valuesDescription
voiceenumlonganqian_v3.1longanqian_v3.1, longanhuan_v3.1, longanlingxin_v3.1, longanf...Speaking voice for the session. Set it with session.update before the model produces any audio. These voices are specific to this model.
instructionsstring--System guidance for how the model should behave and speak during the conversation.
input_languageenumautoauto, zh, en, ja, ko, vi, th, id, ar, fr, de, es, pt, ru, itLanguage you speak. The transcript of your speech is written in it; auto detects it. Also accepted as input_audio_transcription.language.
output_languageenumautoauto, zh, en, ja, ko, vi, th, id, ar, fr, de, es, pt, ru, itLanguage the spoken reply is read in, for example Japanese or Chinese for the same characters. It does not translate the reply: ask for its language in your...
speednumber-0.5 to 2Speaking rate of the reply, from 0.5 to 2. Lower values slow the speech and higher values speed it up. Also accepted as speech_rate. When omitted, the model's own...
enable_speech_emotionbooleantrue-More pronounced emotion in the spoken reply. Turn it off for a more even delivery.
max_history_turnsinteger-1 to 50How many earlier exchanges the model reads for each reply, from 1 to 50. Fewer exchanges use fewer input tokens. When omitted, the model's own default applies.
enable_searchbooleanfalse-Search the web for real-time information. Works in the same session as function calling. Search results are added to the conversation and count as input tokens.
modalitiesstring["text","audio"]-Which output types the model returns for a turn. Drop audio for a text-only reply.
input_audio_formatenumpcm16pcm16Encoding of the audio you append to the input buffer: base64 16-bit PCM at 16 kHz.
output_audio_formatenumpcm24pcm24Encoding of the audio the model streams back: 16-bit PCM at 24 kHz.
turn_detectionstring{"type":"server_vad"}-Voice activity detection: decides when you have finished speaking and the model should reply. It is on by default as server_vad, which ends your turn after a pause....

Good to know

Connecting

Full-duplex voice over a WebSocket at wss://api.empiriolabs.ai/v1/realtime?model=qwen-audio-3-1-realtime-flash, authenticated with the ordinary Authorization Bearer header. Configure the session with session.update over the socket: voice, instructions, modalities, turn detection, languages and delivery.

Sending audio

  • Append microphone audio as input_audio_buffer.append events.
  • Voice activity detection decides when you have stopped speaking, so keep streaming for about a second after the speech ends.

Language and delivery

Set input_language to the language you speak, which the transcript of your speech is written in, and output_language to the language the spoken reply is read in. Each takes auto or one of zh, en, ja, ko, vi, th, id, ar, fr, de, es, pt, ru and it. The output language does not translate the reply, so ask for its language in your instructions too. 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.

Voices

The voices on this model are its own set. Pick one from the voice list rather than carrying a voice across from another model, or leave it unset and the default is supplied for you.

Web search

Web search is off by default. Turn it on with enable_search. It works in the same session as function calling, and search results are added to the conversation and count as input tokens.

Billing

Audio and text tokens are priced separately in both directions. A spoken reply is billed for its audio output tokens only, and the text output rate applies to replies with no audio. Each completed turn is billed on its own from the usage the model reports.

Qwen Audio 3.1 Realtime Flash API: common questions

How much does the Qwen Audio 3.1 Realtime Flash API cost?

On EmpirioLabs, Qwen Audio 3.1 Realtime Flash is billed pay as you go: Input: audio $1.86 per 1M audio input tokens; Input $0.46 per 1M prompt tokens; Output $1.40 per 1M generated tokens, text-only replies; Output: audio $3.74 per 1M generated audio tokens; Web search $0.00 per call when invoked. The live rate card on this page always matches what the API charges.

What is the context window of Qwen Audio 3.1 Realtime Flash?

Qwen Audio 3.1 Realtime Flash supports a 240K-token context window with up to 16,384 output tokens per response.

Which endpoint does Qwen Audio 3.1 Realtime Flash use?

Qwen Audio 3.1 Realtime Flash is served through WEBSOCKET /v1/realtime on api.empiriolabs.ai with standard bearer-token authentication.

Can I try Qwen Audio 3.1 Realtime Flash in the browser before integrating?

Open the EmpirioLabs playground and press Start session to try it in your browser. Qwen Audio 3.1 Realtime Flash runs over a WebSocket rather than a request and response, so to build with it start from the realtime voice quickstart. Connect from your server with your EmpirioLabs API key and the model id qwen-audio-3-1-realtime-flash, then stream audio in both directions.

How do I get a Qwen Audio 3.1 Realtime Flash API key?

Create an EmpirioLabs account, then generate a key under API Keys in the dashboard. Billing is pay-as-you-go credits, so you only pay for the requests you make.

Compare Qwen Audio 3.1 Realtime Flash with other models

All model comparisons

Ready to use better endpoints?

Check out our pricing or reach out if you want your own model deployed on our stack.