Experimental SSML

Write the conversation.
Kokoro voices perform it.

One request can alternate characters, route each line through its native language, direct pace and expression, add deliberate pauses, and return one finished audio file or stream.

KokoroTTS mascot
Two voices, one request

Morning model meeting

Heart + Michael
Heart

Good morning, Michael! Did you remember to warm up the speech model?

Michael

I did! But it started talking before I finished my coffee.

Heart

That sounds less like a bug and more like enthusiasm!

Michael

So our synthetic colleague is officially the most productive one here!

The complete script

Dialogue SSML

<speak>
  <voice name="af_heart">
    <prosody speed="0.95" pitch="+1st">
      Good morning, Michael! Did you remember to warm up the speech model?
    </prosody>
  </voice>
  <break time="140ms"/>
  <voice name="am_michael">
    <prosody speed="0.9" pitch="-1st" tempo="0.98">
      I did! But it started talking before I finished my coffee.
    </prosody>
  </voice>
  <break time="140ms"/>
  <voice name="af_heart">
    <prosody speed="1.05" pitch="+1.5st">
      That sounds less like a bug and more like enthusiasm!
    </prosody>
  </voice>
  <break time="140ms"/>
  <voice name="am_michael">
    <prosody speed="0.92" pitch="-1st" volume="0.95">
      So our synthetic colleague is officially the most productive one here!
    </prosody>
  </voice>
</speak>
Direct the performance

Choose the performer, language, and delivery

<lang> keeps the voice

Route a phrase through another language frontend while keeping the selected voice. This preserves character identity, including the accent and limitations of that voice.

<speak>
  你好,
  <lang xml:lang="en-US">
    Kokoro text to speech
  </lang>
  很高兴认识你。
</speak>

<voice> changes the performer

Select an enabled voice for each segment. Its native language frontend and matching model family are used automatically for more reliable multilingual dialogue.

<speak>
  <voice name="zf_xiaoxiao">你好!</voice>
  <voice name="af_heart">Hello!</voice>
  <voice name="dm_martin">Guten Tag!</voice>
</speak>

<prosody> styles a segment

Set any combination of model speed, pitch in semitones, post-synthesis tempo, and volume. Omitted or blank attributes inherit unchanged, so each dialogue turn only needs the direction that matters.

<speak>
  Calm and neutral.
  <prosody speed="0.9" pitch="-1st">
    Slower and lower.
  </prosody>
  <prosody tempo="1.1" volume="0.85">
    Quicker and quieter.
  </prosody>
</speak>
Native API

Generate your own

curl -X POST "http://localhost:7860/tts/generate" \
  -H "Content-Type: application/json" \
  -d '{"input_type":"ssml","text":"<speak><voice name=\"af_heart\">Hello.</voice><voice name=\"am_michael\"><prosody speed=\"0.9\" pitch=\"-1st\">Hi there.</prosody></voice></speak>","voice":"af_heart","output_format":"mp3"}' \
  -o dialogue.mp3

SSML is explicit and experimental. Adjacent turns use a compact 100 ms handoff; add <break> to choose the complete pause, including 0ms for no gap. Plain text remains the default, and the OpenAI-compatible endpoint continues to accept plain text only.