Skip to content

Text to Speech (text → audio) ​

yaoshu-audio provides non-realtime speech synthesis: send a piece of text and get a complete audio file back. It fits voice assistants, content voice-over, audiobooks, customer service, and similar scenarios. The OpenAI SDK's audio.speech.create() works as-is.

The platform's current HTTP contract returns the complete audio in a single request (the response body is the audio binary itself — write it to disk and you have the audio file, with no JSON wrapper). It is not a WebSocket and has no SSE — do not send streaming request headers when integrating.

1. Endpoint and Authentication ​

bash
curl https://token.yaoshu.cc/v1/audio/speech \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "yaoshu-audio",
    "input": "The weather is nice today — good for a walk.",
    "voice": "longanhuan_v3.1",
    "response_format": "mp3"
  }' \
  --output speech.mp3
  • Endpoint: POST /v1/audio/speech
  • Authentication: Authorization: Bearer sk-your-api-key (platform API Key)
  • Response: 200 + audio binary (Content-Type follows the format, e.g. audio/mpeg); write it to disk directly

2. Complete Request Parameters ​

ParameterTypeRequiredDescription
modelstring✅yaoshu-audio
inputstring / string[]✅Text to synthesize; an array is concatenated into one passage
voicestring✅Voice ID, case-sensitive, must match the current model version (see "Full System Voice Table"). An invalid value returns a parameter error
response_formatstringNomp3 (default) / wav / pcm / opus
speednumberNoSpeech rate [0.5, 2.0], default 1.0
sample_ratenumberNoSample rate in Hz: 8000 / 12000 / 16000 / 22050 (default) / 24000 / 44100 / 48000. opus supports only 8000, 12000, 16000, 24000, 48000. Output can reach 48 kHz
volumenumberNoVolume [0, 100], default 50
pitchnumberNoPitch [0.5, 2.0], default 1.0
seednumberNo[0, 65535], default 0. Reproducible with the same text, voice, and parameters
language_hintsstring[]NoOnly the first value is processed. Values: zh en fr de ja ko ru pt th id vi es it ms fil ar. Use it when numbers, abbreviations, symbols, or less common languages are read inaccurately
instructionstringNoNatural language controlling dialect, emotion, or role (see "Instruction Control"). instructions is a synonym; prefer instruction
bit_ratenumberNoopus only, in kbps, [6, 510], default 32
word_timestamp_enabledbooleanNoWord-level timestamps, default false. When true, the response switches from audio binary to JSON (see "Word-Level Timestamps")
hot_fixobjectNoText hot-fix, containing pronunciation (pinyin annotation on specified words to correct pronunciation) and replace (text replacement before synthesis). Structure: {"hot_fix":{"pronunciation":[{"天气":"tian1 qi4"}],"replace":[{"今天":"金天"}]}}. A malformed structure does not raise a server error — it silently synthesizes with default behavior — always send this exact structure
enable_aigc_tagbooleanNoWhether to embed an implicit AIGC label in the generated audio (supports wav / mp3 / opus), default false
aigc_propagatorstringNoContentPropagator of the implicit AIGC label; effective only with enable_aigc_tag=true; when omitted, the platform fills it with the default account identifier
aigc_propagate_idstringNoPropagateID of the implicit AIGC label (uniquely identifies one propagation); effective only with enable_aigc_tag=true; when omitted, the Request ID of this request is used

3. Full System Voice Table (68 voices) ​

voice values are case-sensitive; voices are tightly bound to a model version, and mixing versions raises an error. The full table is grouped by function into four groups:

3.1 Multilingual and Dialect Voices (4) ​

All four voices support every dialect and language listed below, and you can switch dialect expression with instruction.

Namevoice parameterGender
龙安欢_v3.1longanhuan_v3.1Female
龙安灵心_v3.1longanlingxin_v3.1Female
龙安风悦_v3.1longanfengyue_v3.1Female
许南川xunanchuan_v3.1Male

These 4 voices all support:

  • Dialects (8): Shanghainese, Cantonese, Northeastern Mandarin, Chongqing dialect, Shaanxi dialect, Yunnan dialect, Ningbo dialect, Gansu dialect (specified with instruction, e.g. "please speak in Shaanxi dialect")
  • Languages (8): Japanese, Korean, French, German, Portuguese, Italian, Vietnamese, Indonesian

3.2 Premium Chinese Voices (22) — Mandarin Chinese only ​

Namevoice parameterGenderTimbreUse cases
于小云yuxiaoyun_v3.1FemaleEnergetic, friendly, naturalAdvertising, broadcasting, customer service assistant, narration
乔小娇qiaoxiaojiao_v3.1FemalePretty, cuteAdvertising, customer service assistant, audiobooks
夏小晨xiaxiaochen_v3.1FemaleEnergetic, brightAdvertising, audiobooks
安明远anmingyuan_v3.1MaleClear, naturalAdvertising, audiobooks, narration
温怀清wenhuaiqing_v3.1FemaleClear, gentleChildren's stories, customer service assistant, advertising, news broadcasting
安小岚anxiaolan_v3.1FemaleSweet, pureAudiobooks, customer service assistant, narration, news broadcasting, advertising
谢舒柔xieshurou_v3.1FemaleGentle, natural, intellectualAudiobooks, customer service assistant, narration
白清岚baiqinglan_v3.1FemaleBright, pureVoice assistant, customer service assistant
许玉远xuyuyuan_v3.1FemaleIntellectual, mature, texturedAdvertising, news broadcasting, narration, customer service assistant, audiobooks
安若柔anruorou_v3.1FemaleBreathy, intellectualNarration, voice assistant
闻怀之wenhuaizhi_v3.1FemaleSteady, matureAudiobooks, news broadcasting, advertising, customer service assistant, narration
萧行之xiaoxingzhi_v3.1FemaleDignified, refinedNews broadcasting, audiobooks, narration, customer service assistant
顾云舒guyunshu_v3.1FemaleMature, steadyMusic radio, customer service assistant, audiobooks, narration
霍拙石huozhuoshi_v3.1MaleClearAudiobooks, advertising, narration
叶清禾yeqinghe_v3.1FemaleFriendly, gentleAudiobooks, advertising, narration, customer service assistant
云欢欢yunhuanhuan_v3.1FemaleHigh-pitched, passionateAudiobooks, narration, customer service assistant
徐小俏xuxiaoqiao_v3.1FemaleNatural, playfulAudiobooks, narration, customer service assistant
白安然baianran_v3.1FemaleDeep, resonant, breathyVoice-over explanation, audiobooks, narration
许言初xuyanchu_v3.1FemaleCalm, magneticNews broadcasting, audiobooks
叶知晴yezhiqing_v3.1FemaleLight, naturalChildren's stories, customer service assistant, voice assistant
安迪andi_v3.1MaleABC accentVoice assistant
安语晴anyuqing_v3.1FemaleSweet girlishVoice assistant, narration, news broadcasting

3.3 Premium English Voices (15) — English only ​

Namevoice parameterGenderAccent
EmilyEmily_v3.1FemaleBritish
LunaLuna_v3.1FemaleBritish
EricEric_v3.1MaleBritish
LucaLuca_v3.1MaleBritish
AbbyAbby_v3.1FemaleAmerican
AnnieAnnie_v3.1FemaleAmerican
AvaAva_v3.1FemaleAmerican
BethBeth_v3.1FemaleAmerican
BettyBetty_v3.1FemaleAmerican
CallyCally_v3.1FemaleAmerican
CindyCindy_v3.1FemaleAmerican
DonnaDonna_v3.1FemaleAmerican
AndyAndy_v3.1MaleAmerican
BrianBrian_v3.1MaleAmerican
DavidDavid_v3.1MaleAmerican

3.4 Other System Voices (27) — Mandarin Chinese (unless noted) ​

Namevoice parameterGenderTimbreUse cases
龙安元妃_v3.1longanyuanfei_v3.1FemaleHaughty imperial consortSocial companionship
龙杰力豆_v3.1longjielidou_v3.1MaleInnocent boyChildren's companionship
龙安灵希_v3.1longanlingxi_v3.1FemaleCute and sweetSocial companionship
龙火火_v3.1longhuohuo_v3.1MalePlayful teenage boyCharacter voice
龙应桃_v3.1longyingtao_v3.1FemaleGentle and composedCustomer service
龙安雅_v3.1longanya_v3.1FemaleElegant and refinedSocial companionship
龙婉_v3.1longwan_v3.1FemaleDelicate and soft-spokenSocial companionship
龙星_v3.1longxing_v3.1FemaleGentle, girl-next-doorSocial companionship
龙华_v3.1longhua_v3.1FemaleEnergetic and sweetSocial companionship
龙寒_v3.1longhan_v3.1MaleWarm and devotedSocial companionship
龙安智_v3.1longanzhi_v3.1MaleWise, young-matureSocial companionship
龙哲_v3.1longzhe_v3.1MaleBland, warm-heartedSocial companionship
龙安洋_v3.1longanyang_v3.1MaleSunny young manSocial companionship (benchmark voice)
李白_v3.1libai_v3.1MaleAncient poetPoetry recitation
龙铃_v3.1longling_v3.1FemaleChildish and flatChildren's voice
龙牛牛_v3.1longniuniu_v3.1MaleSunny boyConsumer electronics — children's audiobooks
龙闪闪_v3.1longshanshan_v3.1MaleTheatrical childConsumer electronics — children's audiobooks
龙泡泡_v3.1longpaopao_v3.1FemaleAiry, bubble-likeConsumer electronics — children's companionship
loongstella_v3.1loongstella_v3.1FemaleCrisp and decisiveNews broadcasting
龙媛_v3.1longyuan_v3.1FemaleWarm and healingAudiobooks
龙妙_v3.1longmiao_v3.1FemaleMelodic and expressiveAudiobooks
龙三叔_v3.1longsanshu_v3.1MaleSteady and texturedAudiobooks
龙安莉_v3.1longanli_v3.1FemaleCrisp and poisedVoice assistant
龙安温_v3.1longanwen_v3.1FemaleElegant and intellectualVoice assistant
龙安朗_v3.1longanlang_v3.1MaleFresh and crispVoice assistant
龙小夏_v3.1longxiaoxia_v3.1FemaleSteady and authoritativeVoice assistant
龙安冲_v3.1longanchong_v3.1MalePassionate salesLivestream commerce

The full table is maintained from the same source as the voice list on the platform's service lines; a voice is listed only after group sampling validation on the platform side. Voice cloning and voice design (custom dedicated voices): the platform already has this capability; public availability is to be announced.

4. Emotion and Rich-Language Tags ​

Written into the text to synthesize (input), these tags take effect as-is with no extra parameters. Control tags apply to the text after them, up to the next control tag:

TagEffectTagEffect
[sad]Sad[bored]Bored
[amazed]Amazed[tired]Tired
[deep and loud shouting]Deep, loud shouting[scornful]Scornful
[trembling]Trembling[shouting]Shouting
[angry]Angry[asmr]ASMR soft whisper
[excited]Excited[panicked]Panicked
[sarcastic]Sarcastic[mischievously]Mischievous
[curious]Curious[empathetic]Empathetic
[like dracula]Deep and eerie[whispers]Whispering
[reluctantly]Reluctant[crying]Crying
[serious]Serious[very slowly]Very slowly
[very fast]Very fast

Onomatopoeia tags insert an effect at that position only and do not change the surrounding emotion:

TagEffect
[gasp]Gasp
[sighing]Sighing
[clears throat]Clears throat
[giggles]Giggles
[laughing]Laughing
[cough]Cough
[snorts]Snorts

Combined example (control tags + onomatopoeia + emotion switching):

text
[excited]The weather is lovely today![laughing]Let's go out and play!
[serious]Please note the safety instructions.[excited]Alright, let's begin!

5. Instruction Control (instruction) ​

instruction describes voice characteristics in natural language to set dialect, emotion, or role; it layers on top of the fixed voice. Do not write "imitate a certain celebrity" (not supported, and a copyright risk).

Writing tips: be specific, not vague ("low-pitched, slightly faster" beats "nice-sounding"); combine dimensions (gender + age + pitch + speed + emotion + traits + purpose):

  • Broadcasting: "Read in standard Mandarin with a clear broadcast tone"
  • Young female, on the fast side: "Young female voice, slightly fast, with a light and cheerful delivery"
  • Steady male: "Steady male voice, slightly slow, clear articulation, deep and magnetic timbre, suitable for documentary narration"
  • Gentle female: "Gentle female voice, slightly lower volume, mild delivery"
  • Child: "Child voice, about 8 years old, higher pitch, lively delivery, suitable for animated character dubbing"
  • Dialect: "Please speak in Chongqing dialect" (supported only by the 4 voices in the multilingual and dialect group)

6. Word-Level Timestamps (word_timestamp_enabled: true) ​

For scenarios that need "each word ↔ audio time" alignment — video dubbing subtitles, word-by-word highlighting (karaoke) and the like — add "word_timestamp_enabled": true to the request body: the response body switches from audio binary to JSON, delivering the audio (Base64) and per-word timestamps in one call, with no need to reverse-engineer alignment through speech recognition. Billing is unchanged when this is enabled.

json
{
  "audio": "<Base64-encoded complete audio; decode it to get the audio file>",
  "format": "mp3",
  "duration": 1.0,
  "words": [
    {"text": "今", "begin_time": 0,   "end_time": 62,  "begin_index": 0, "end_index": 1},
    {"text": "天", "begin_time": 62,  "end_time": 125, "begin_index": 1, "end_index": 2}
  ]
}

Timestamps are in milliseconds; duration is in seconds.

7. Errors and Handling ​

SymptomCauseHandling
400 parameter error (with a voice hint)voice misspelled / voice from another version / unsupported format (flac, aac)Check the voice table and the format value range, then resend
400 parameter error (speed / pitch / volume)Value outside the range in §2Adjust it into range
Odd pronunciation because voice and language do not matchA premium Chinese voice paired with English text (or vice versa)Switch to a voice allowed by the group's language

8. Limits ​

  • response_format value range: mp3 / wav / pcm / opus (flac / aac from the OpenAI protocol are not supported)
  • sample_rate defaults to 22050 — send it explicitly when you need 24 kHz or 48 kHz
  • Voices are tightly bound to the model version: only the voice values in this page's full table are usable

9. SDK Access (OpenAI SDK, zero changes) ​

python
from openai import OpenAI

client = OpenAI(api_key="sk-your-api-key", base_url="https://token.yaoshu.cc/v1")

with client.audio.speech.create(
    model="yaoshu-audio",
    voice="longanhuan_v3.1",
    input="Hello, this is a sample from the text-to-speech endpoint.",
) as response:
    with open("speech.mp3", "wb") as f:
        for chunk in response.iter_bytes():
            f.write(chunk)

10. Billing ​

Billed precisely by input character count (CNY per million characters, counting Unicode code points; the gateway counts regardless of channel); failed requests are not charged. The unit price is shown on the model pricing page in the console.

Public documentation for platform users