Skip to navigation

Seed ASR 2.0 Stream

Seed ASR 2.0 Stream
ByteDance · Transcription
WEBSOCKET /v1/realtime

Live transcription over a WebSocket in 67 languages: Chinese and English arrive word by word while the speaker talks, other languages in passages, priced per hour of audio.

See Seed ASR 2.0 Stream pricing and specs or try it in the Playground.

At a glance

FieldValue
Model idseed-asr-2-0-stream
Model release date-
Input modalitiesAudio
Output modalitiesText
Context window-
Weight precision-
RegionMalaysia
Featurestranscription, speech_to_text, realtime, streaming_asr, multilingual, hotwords
Native inferenceNo
NewYes
Supported endpointsWEBSOCKET /v1/realtime
Alternate model idsseed-asr-2.0-stream, bytedance/seed-asr-2.0-stream, bytedance/seed-asr-2-0-stream

Pricing

ChargeSpecRate
Transcriptionper hour of audio$0.30

Example request

import asyncio, json, os, websockets
URL = "wss://api.empiriolabs.ai/v1/realtime?model=seed-asr-2-0-stream"
async def main():
async with websockets.connect(
URL,
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.done":
break
asyncio.run(main())

Parameters

ParameterTypeRequiredDefaultDescription
languageenumno"auto"Language spoken. auto, zh, yue and en stream Chinese (Mandarin and dialects such as Cantonese) and English word by word as they are spoken. Every other language, and multi (which detects any of them), streams its text about every 20 seconds, and at once when you commit the audio buffer. · Allowed: auto, multi, en, zh, yue, ja, ko, es, pt, de, fr, it, nl, ru, uk, pl, tr, ar, he, fa, hi, bn, ur, pa, mr, ta, te, kn, ml, ne, sd, ps, id, ms, fil, ceb, jv, th, vi, km, my, kk, uz, az, ku, el, ro, bg, cs, sk, sl, hr, sr, hu, fi, et, lv, lt, da, sv, no, is, ga, sq, ca, af, sw, ha, zu
input_audio_formatenumno"pcm16"The audio you stream: 16 kHz 16-bit mono PCM (pcm16), base64 in input_audio_buffer.append or as binary frames. · Allowed: pcm16
silence_duration_msintegerno800The pause in milliseconds that ends a turn, 300 to 5000 (turn_detection.silence_duration_ms). Chinese and English. · Range: 300 – 5000
two_passbooleannotrueRead each finished turn again for a more accurate final transcript. Chinese and English.
accelerate_scoreintegerno0Show the first words of a turn sooner: 0 (off) to 20 (fastest). Higher values can make the first words less accurate. Chinese and English. · Range: 0 – 20
force_to_speech_timeintegerno0The audio in milliseconds a turn must have before a pause can end it, 0 to 10,000. 0 lets any pause end it. Chinese and English. · Range: 0 – 10000
promptstringno-Text that helps recognition, up to 4,000 characters: names, terms, or what was said just before. · Max: 4000
hotwordsarrayno-Up to 5,000 words or names to recognize as written, each up to 100 characters. · Max: 5000
contextarrayno-Up to 20 earlier turns of the conversation, most recent first, each a string or an object with text (up to 1,000 characters) and an optional speaker, for example user or assistant. Counted with prompt toward the 20. · Max: 20
itnbooleannotrueWrite numbers, dates and amounts as digits and symbols, for example 20% for twenty percent.
punctuationbooleannotrueAdd punctuation.
disfluency_removalbooleannofalseRemove filler words and repetitions such as um, uh and repeated words. Chinese and English.
traditional_chineseenumno"off"Write Chinese in Traditional characters: traditional, tw (Taiwan) or hk (Hong Kong). off keeps Simplified. · Allowed: off, traditional, tw, hk
sensitive_words_filterobjectno-Hide words in the text: an object with filter_with_empty (words to remove), filter_with_signed (words to replace with *), system_reserved_filter (true also replaces a built-in list of restricted words with *) and wrap_with_marks (true wraps each filtered word in backticks).
show_speech_ratebooleannofalseAdd each segment’s speech rate, in tokens per second.
show_volumebooleannofalseAdd each segment’s volume, in dB.

Notes

Connect

  • WEBSOCKET /v1/realtime?model=seed-asr-2-0-stream, in the OpenAI Realtime transcription protocol: stream 16 kHz mono 16-bit PCM (pcm16) with input_audio_buffer.append, as base64 or binary frames.
  • Transcripts arrive as conversation.item.input_audio_transcription.delta while the speaker talks and conversation.item.input_audio_transcription.completed when a turn ends.

Languages

  • language, on the URL or in session.update: auto (default), zh, yue and en stream Chinese, its dialects and English word by word. Every other language, and multi (any language, detected), streams its text about every 20 seconds and at each commit.
  • Set language for speech that changes language: detection can miss a change.
  • prompt, hotwords and context help recognize names and terms.

Turns

  • A pause of silence_duration_ms (800 by default) ends a turn; with turn_detection set to null, input_audio_buffer.commit ends one.
  • two_pass (on) reads each finished turn again for a more accurate final transcript, and accelerate_score shows a turn’s first words sooner. Chinese and English.
  • itn and punctuation (both on), disfluency_removal, traditional_chinese and sensitive_words_filter shape the text.

Billing

  • Billed per second of audio sent, at the hourly rate. An open connection with no audio is not billed.

Machine-readable schema: GET https://api.empiriolabs.ai/v1/models/seed-asr-2-0-stream.