Seed TTS 2.0 is available on EmpirioLabs. It is ByteDance's context-aware text-to-speech model: you tell it how to read in plain language, such as "speak a bit slower, in a cheerful tone", and the instruction itself is not billed. It has 203 preset voices, each reading the languages listed for it, streams audio as it is generated, and returns word timestamps for Chinese and English. It is billed per character of input.
Try it in the Playground, read the parameters in the docs, and see the current rates on the Seed TTS 2.0 model page.
Pick a voice, then speak
List the voices that read your language with GET /v1/voices, then send the text with an instruction:
import os
import requests
API = "https://api.empiriolabs.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['EMPIRIOLABS_API_KEY']}"}
voices = requests.get(f"{API}/voices", headers=HEADERS, timeout=60,
params={"model": "seed-tts-2-0", "language": "Spanish"}).json()
print(voices["total"], "voices read Spanish, for example", voices["data"][0]["id"])
response = requests.post(f"{API}/audio/speech", headers=HEADERS, timeout=120, json={
"model": "seed-tts-2-0",
"input": "Thanks for calling. Your package is out for delivery and should arrive this afternoon.",
"voice": "en_female_dacey_uranus_bigtts",
"instruction": "Speak warmly and a little slower, like a friendly support agent.",
"response_format": "wav",
"sample_rate": "24000",
})
response.raise_for_status()
result = response.json()
with open("support.wav", "wb") as f:
f.write(requests.get(result["data"][0]["url"], timeout=60).content)
print(result["usage"]["billable_characters"], "characters billed; the instruction is not")
It printed 17 voices read Spanish, for example mx_male_migu_uranus_bigtts and 86 characters billed; the instruction is not.
Controls
instruction: emotion, tone and pace in plain language, up to 1,000 characters.language:auto(the default) detects it; a code such asen,jaores-mx, or a name such as"Japanese", reads the text in that one language.speed,volumeandpitch: 0.5 to 2.0, 0.5 to 2.0, and -12 to 12 semitones.response_format:mp3(the default),opus,wavorpcm;silence_durationadds up to 30 seconds of silence at the end.- Streaming:
POST /v1/audio/speech:streamtakes the same body and sendsaudio.chunkevents as the audio is generated.
Speaking text as it is written
WEBSOCKET /v1/realtime?model=seed-tts-2-0 takes text while it is still being written, for example a language model's reply, and returns the audio as it is generated. Send the text in pieces with input_text_buffer.append, then session.finish, and set the voice, language and other options with session.update. instruction directs the delivery, and a custom voice_id speaks too.
import asyncio, base64, json, os, websockets
URL = "wss://api.empiriolabs.ai/v1/realtime?model=seed-tts-2-0"
KEY = os.environ["EMPIRIOLABS_API_KEY"]
async def main():
async with websockets.connect(URL, additional_headers=[("Authorization", f"Bearer {KEY}")], max_size=None) as ws:
await ws.recv() # session.created
await ws.send(json.dumps({"type": "session.update", "session": {"language": "en", "instruction": "Warm, like a late-night radio host"}}))
# Text goes in as it is written, for example a language model's reply.
for piece in ["Good evening, ", "and welcome back. ", "Here is what changed today."]:
await ws.send(json.dumps({"type": "input_text_buffer.append", "text": piece}))
await ws.send(json.dumps({"type": "session.finish"}))
audio = bytearray()
async for raw in ws:
event = json.loads(raw)
if event["type"] == "response.audio.delta":
audio.extend(base64.b64decode(event["delta"])) # 16-bit PCM, 24,000 Hz, mono
elif event["type"] == "response.done":
print("segment:", event["response"]["usage"]["billable_characters"], "characters")
elif event["type"] == "session.finished":
break
print(f"{len(audio) / 48000:.1f} s of audio")
asyncio.run(main())
It printed segment: 59 characters and 4.2 s of audio. Text is spoken in segments that end at sentence boundaries, and each segment's response.done carries its usage, billed like the same text in a request. The Playground runs the same session with its Realtime switch.
Watch the launch film
Both lines in the film are one Seed TTS 2.0 voice through the EmpirioLabs API, directed first to be calm and then excited. Watch it on YouTube.
Operational notes
- Choose a voice that reads your language. Each voice lists its own languages; filter with
?language=. A voice id from another Seed model is refused. - Sample rates are 8,000, 16,000 or 24,000 Hz. A higher rate is refused, so leave
sample_rateunset for 24,000. - A Chinese character counts as two characters. The usage block shows
charactersas written andbillable_charactersas billed. - For audio tags or more languages, use Seed TTS 3.0. It takes inline tags such as
[laughs]and reads 119 languages and dialects with every voice.




