
Live transcription over a socket, streaming partial words while the speaker talks and a settled sentence at each pause, priced per hour of audio.
Live transcription over a socket, streaming partial words while the speaker talks and a settled sentence at each pause, priced per hour of audio.
Stream 16 kHz pcm16 audio over the socket. Partial results arrive while the speaker is talking. Set the language, a prompt and the pause that ends a sentence in session.update.
Also known as Qwen Audio ASR Stream, Alibaba Cloud Qwen Audio 3.0 ASR Stream
qwen-audio-3-0-asr-stream/v1/realtimeqwen-audio-3.0-asr-streamalibaba/qwen-audio-3-0-asr-streamLive pay-as-you-go rates from the EmpirioLabs catalog. You are billed only for what you use, with no monthly minimum.
Qwen Audio 3.0 ASR Stream transcribes a live audio stream over a WebSocket at wss://api.empiriolabs.ai/v1/realtime?model=qwen-audio-3-0-asr-stream, not over the HTTP endpoints. Connect with the model id qwen-audio-3-0-asr-stream and send your EmpirioLabs API key as an Authorization: Bearer header on the handshake. Append base64 16-bit PCM audio and read transcript events back while the speaker is still talking. 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.
import asyncio, json, os, websockets
async def main():
async with websockets.connect(
"wss://api.empiriolabs.ai/v1/realtime?model=qwen-audio-3-0-asr-stream",
additional_headers=[
("Authorization", f"Bearer {os.environ['EMPIRIOLABS_API_KEY']}"),
],
max_size=None,
) as ws:
print(json.loads(await ws.recv())["type"]) # session.created
import base64
# 16-bit PCM microphone audio, base64 encoded, in small chunks.
for chunk in read_microphone_chunks():
await ws.send(json.dumps({
"type": "input_audio_buffer.append",
"audio": base64.b64encode(chunk).decode(),
}))
await ws.send(json.dumps({"type": "input_audio_buffer.commit"}))
async for raw in ws:
event = json.loads(raw)
if event["type"].endswith("input_audio_transcription.delta"):
# "text" is settled transcript; "stash" is still in progress.
if event.get("text"):
print(event["text"], end="", flush=True)
asyncio.run(main())Request parameters supported by the Qwen Audio 3.0 ASR Stream API on EmpirioLabs. Defaults apply when a field is omitted.
| Parameter | Type | Default | Range / values | Description |
|---|---|---|---|---|
| input_audio_format | enum | pcm16 | pcm16 | Encoding of the audio you append to the input buffer: base64 16-bit PCM, mono, at 16 kHz. |
| language | enum | auto | auto, zh, en, ja, ko, vi, th, id, ms, tl, hi, ar, fr, de, es,... | Language of the speech, or auto to detect it from the audio. Set it with the language query parameter of the connection URL, or as input_audio_transcription.language... |
| prompt | string | - | - | Text that guides recognition, up to 400 characters: the names and terms the speaker uses, or the text spoken just before this audio. Write the words exactly as they... |
| silence_duration_ms | integer | 800 | 200 to 6000 | The pause, in milliseconds, that ends a sentence, from 200 to 6000. A shorter pause settles each sentence sooner; a longer one keeps a pause inside a sentence. Also... |
| threshold | number | - | 0 to 1 | How clear speech must be before it is transcribed, from 0.0 to 1.0. A higher value ignores more background noise and can miss quiet speech. When omitted, the model's... |
| noise_reduction | enum | far_field | far_field, near_field | The microphone the speech detection is tuned for: near_field for a headset or a phone held close, far_field for a laptop or room microphone. Also accepted as... |
| keep_dialect | boolean | false | - | Keeps Chinese dialect words as spoken. When off, dialect speech is written as standard Mandarin. |
Live transcription over a WebSocket at wss://api.empiriolabs.ai/v1/realtime?model=qwen-audio-3-0-asr-stream, authenticated with the ordinary Authorization Bearer header.
Stream 16 kHz mono pcm16 audio with input_audio_buffer.append. Voice activity detection decides where each sentence ends, so there is no commit to send.
Send session.update right after session.created, before the first audio, with any of these settings: input_audio_transcription.language (or the language query parameter of the connection URL; auto by default), input_audio_transcription.prompt with the names and terms the speaker uses (up to 400 characters), turn_detection.silence_duration_ms (200 to 6000, default 800) and turn_detection.threshold (0.0 to 1.0), and input_audio_noise_reduction (near_field or far_field). keep_dialect keeps Chinese dialect words as spoken. A setting changed while audio is streaming ends the sentence in progress and applies to the audio sent after it.
conversation.item.input_audio_transcription.delta events carry the sentence so far while the speaker is still talking, and conversation.item.input_audio_transcription.completed carries the settled sentence at each pause.
Billed per second of the audio you stream, silence included, at the hourly rate shown. The session is billed when it ends.
On EmpirioLabs, Qwen Audio 3.0 ASR Stream is billed pay as you go: Transcription $0.648 per hour of audio. The live rate card on this page always matches what the API charges.
Qwen Audio 3.0 ASR Stream is served through WEBSOCKET /v1/realtime on api.empiriolabs.ai with standard bearer-token authentication.
Open the EmpirioLabs playground and press Start session to try it in your browser. Qwen Audio 3.0 ASR Stream 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-0-asr-stream, then stream audio in both directions.
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.
Check out our pricing or reach out if you want your own model deployed on our stack.