Qwen Audio 3.1 Live API

Full-duplex voice conversation that keeps talking while your application runs delegated tasks, with function calling and billing by the second.

Alibaba Cloud 音频生成 发布日期 2026年11月23日 Singapore 专有端点 新

关于 Qwen Audio 3.1 Live

Full-duplex voice conversation that keeps talking while your application runs delegated tasks, with function calling and billing by the second.

Session is configured with session.update events over the socket rather than request parameters. A session is billed by its length, per second, at least 3 seconds.

也称为 Qwen Audio Live, Alibaba Cloud Qwen Audio 3.1 Live

realtime speech to speech audio in audio out function calling

Qwen Audio 3.1 Live 规格

模型 ID
qwen-audio-3-1-live
开发方
Alibaba Cloud
类别
音频生成
发布日期
2026年11月23日
输入
音频文本
输出
音频文本
区域
Singapore
端点
WEBSOCKET/v1/realtime
备用模型 ID
qwen-audio-3.1-livealibaba/qwen-audio-3-1-live

Qwen Audio 3.1 Live API 价格

来自 EmpirioLabs 目录的实时按量计费价格。也可以选择包含每周用量额度的套餐。

类型
规格
价格
Session
per second
$0.00142
在完整价格页比较

如何调用 Qwen Audio 3.1 Live API

Qwen Audio 3.1 Live 通过 wss://api.empiriolabs.ai/v1/realtime?model=qwen-audio-3-1-live 的 WebSocket 进行实时对话,而不是通过 HTTP 端点。使用模型 id qwen-audio-3-1-live 连接,并在握手时将 EmpirioLabs API 密钥作为 Authorization: Bearer 请求头发送。音频以 base64 编码的 16 位 PCM 双向传输。 浏览器无法为 WebSocket 设置请求头,请从你的服务器发起该连接,再通过你自己的 socket 把音频转发给浏览器。 在EmpirioLabs 控制台获取 API 密钥。

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-live",
        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())
Qwen Audio 3.1 Live API 完整参考

Qwen Audio 3.1 Live API 参数

EmpirioLabs 上 Qwen Audio 3.1 Live API 支持的请求参数。省略字段时使用默认值。

参数类型默认值范围 / 值描述
voiceenumyunshuyunshu, xiaoman, wanfeng, qingyou, poxiao, maiya, wulong, xue...Speaking voice of the qwen-audio-4.0-realtime-preview frontend, set with session.update. With qwen-audio-3.1-realtime-flash, use a voice of Qwen Audio 3.1 Realtime...
instructionsstring--System guidance for how the model should behave and speak during the conversation.
modelenumqwen-audio-4.0-realtime-previewqwen-audio-4.0-realtime-preview, qwen-audio-3.1-realtime-flashThe voice model that holds the conversation, required in session.update. qwen-audio-4.0-realtime-preview listens while it speaks (set turn_detection to duplex);...
delegationstring--How delegated tasks run. {"type": "client"} hands a longer task to your application as a session.delegation.created event while the model keeps talking; return its...
input_audio_formatenumpcmpcmEncoding of the audio you send in session.input_audio.append: base64 16-bit PCM at 16 kHz, mono.
output_audio_formatenumpcmpcmEncoding of the audio the model streams back in session.output_audio.delta: 16-bit PCM at 24 kHz, mono.
turn_detectionstring{"type":"duplex"}-duplex with qwen-audio-4.0-realtime-preview, which listens while it speaks and can be interrupted at any moment. Leave it out with qwen-audio-3.1-realtime-flash,...

须知

Connecting

Full-duplex voice over a WebSocket at wss://api.empiriolabs.ai/v1/realtime?model=qwen-audio-3-1-live, authenticated with the ordinary Authorization Bearer header. This model has its own event protocol, described below, rather than the OpenAI Realtime protocol.

Setting up the session

Send one session.update and wait for session.updated. session.model is required:

  • qwen-audio-4.0-realtime-preview with turn_detection set to {"type": "duplex"} listens while it speaks, so it can be interrupted at any moment.
  • qwen-audio-3.1-realtime-flash answers after you pause. Leave turn_detection out with it.

Set voice, instructions and tools in the same event.

Sending and receiving audio

  • Send microphone audio as session.input_audio.append events: base64 16-bit PCM at 16 kHz, mono, in small frames (20 ms works well).
  • The reply streams as session.output_audio.delta events: base64 16-bit PCM at 24 kHz, mono.
  • session.input_transcript.delta carries the transcript of your speech and session.output_transcript.delta the reply's subtitles.
  • session.input_audio.mute and session.input_audio.unmute pause and resume listening without ending the session.
  • Text sent as an input_text message with session.item.create adds information to the spoken conversation.
  • session.usage.updated reports the session's elapsed seconds every 5 seconds.

Delegated tasks and tools

  • With delegation set to {"type": "client"}, the model hands a longer task to your application in a session.delegation.created event and keeps talking meanwhile. Report progress with session.thinking.append, ask the user for a missing detail with session.instruction.append, and return the result with session.commentary.append, each carrying the task's delegation_id. For sessions that delegate tasks, use qwen-audio-3.1-realtime-flash, which reads each returned result aloud.
  • A function declared in tools is called with a session.event whose event.item is a function_call. Run it once per call_id and return the result with session.item.create as a function_call_output.
  • Backend responses (responses delegation) and the WebRTC and AOQ transports are not available on this model.

Voices

With qwen-audio-4.0-realtime-preview, choose one of the 8 voices in the voice list. With qwen-audio-3.1-realtime-flash, use a voice of Qwen Audio 3.1 Realtime Flash, or leave voice out for its default.

Ending a session

Send session.close and wait for session.closed, or close the socket.

Capacity

When the model is at capacity, a new session receives a session_unavailable error and close code 1013. Try again shortly.

Billing

A session is billed by its length, from when it opens until it closes, in whole seconds, with a partial second counted as a full second and at least 3 seconds per session. Listening, silence and text all count as session time.

Qwen Audio 3.1 Live 相关博客文章

涵盖这个模型的公告、提示词测试和对比文章。

Qwen Audio 3.1 Live API:常见问题

Qwen Audio 3.1 Live API 收费多少?

在 EmpirioLabs,Qwen Audio 3.1 Live 按量计费:Session $0.00142 per second。也可以选择包含每周用量额度的套餐。本页的实时价格表始终与 API 的实际计费一致。

Qwen Audio 3.1 Live 支持哪些输入和输出?

Qwen Audio 3.1 Live 接受 音频, 文本 作为输入,并返回 音频, 文本。

Qwen Audio 3.1 Live 使用哪个端点?

Qwen Audio 3.1 Live 通过 api.empiriolabs.ai 上的 WEBSOCKET /v1/realtime 提供,使用标准的 Bearer 令牌认证。

Qwen Audio 3.1 Live 的模型 ID 是什么?

在请求中将 qwen-audio-3-1-live 作为 model 发送。备用 ID qwen-audio-3.1-live, alibaba/qwen-audio-3-1-live 同样可用。

Qwen Audio 3.1 Live 是什么时候发布的?

Alibaba Cloud 于 2026年11月23日 发布了 Qwen Audio 3.1 Live。

Qwen Audio 3.1 Live 从哪里提供服务?

EmpirioLabs 上的 Qwen Audio 3.1 Live 从 Singapore 提供服务。

集成之前可以在浏览器里试用 Qwen Audio 3.1 Live 吗?

打开EmpirioLabs Playground并点击 Start session,即可在浏览器中试用。Qwen Audio 3.1 Live 运行在 WebSocket 上,而不是一次请求一次响应,因此接入时请从实时语音快速入门开始。用 EmpirioLabs API 密钥和模型 id qwen-audio-3-1-live 从你的服务器连接,然后双向流式传输音频。

如何获取 Qwen Audio 3.1 Live API 密钥?

创建 EmpirioLabs 账户,然后在控制台的 API Keys生成密钥。计费使用按量付费的额度,只为实际发出的请求付费。也可以选择包含每周用量额度的套餐。

将 Qwen Audio 3.1 Live 与其他模型比较

全部模型比较

准备好使用更好的终端了吗?

查看我们的定价,或者如果你想将自己的模型部署到我们的堆栈中,请联系我们。