English text-to-speech
English (American and British voices): 28 Kokoro voices and 8 expressive Orpheus voices on the OpenAI /v1/audio/speech endpoint. Play each one below. $5.20 per million characters, mp3 or wav, no daily cap.
Voices and samples
Every sample is this sentence, generated through the API with default settings: “The quick brown fox jumps over the lazy dog, and then it stops to enjoy the afternoon sun.”
| Listen | Voice id | Voice | Round-trip check |
|---|---|---|---|
| American, female | All 18 words understood | ||
| American, female | All 18 words understood | ||
| American, female | All 18 words understood | ||
| American, female | All 18 words understood | ||
| American, female | All 18 words understood | ||
| American, female | All 18 words understood | ||
| American, female | All 18 words understood | ||
| American, female | All 18 words understood | ||
| American, female | All 18 words understood | ||
| American, female | All 18 words understood | ||
| American, female | All 18 words understood | ||
| American, male | All 18 words understood | ||
| American, male | All 18 words understood | ||
| American, male | All 18 words understood | ||
| American, male | All 18 words understood | ||
| American, male | All 18 words understood | ||
| American, male | All 18 words understood | ||
| American, male | All 18 words understood | ||
| American, male | All 18 words understood | ||
| American, male | All 18 words understood | ||
| British, female | All 18 words understood | ||
| British, female | All 18 words understood | ||
| British, female | All 18 words understood | ||
| British, female | All 18 words understood | ||
| British, male | All 18 words understood | ||
| British, male | All 18 words understood | ||
| British, male | All 18 words understood | ||
| British, male | All 18 words understood |
Round-trip check: we transcribed each sample with Whisper Large v3 and compared it with the text we sent. It tests whether the speech is intelligible to a machine, not whether it sounds natural to you; for that, listen.
Orpheus voices
Orpheus 3B is slower and costs more, and in exchange it acts: it supports inline tags such as <laugh> and <sigh>. The sample sentence is “I honestly did not expect that to work <laugh> but here we are.”
| Listen | Voice id | Round-trip check |
|---|---|---|
| All 12 words understood | ||
| All 12 words understood | ||
| All 12 words understood | ||
| All 12 words understood | ||
| All 12 words understood | ||
| All 12 words understood | ||
| 2 of 12 words misheard | ||
| All 12 words understood |
Whisper does not transcribe laughter, so the tag is left out of the comparison. Use model: "canopylabs/orpheus-3b-0.1-ft"; details on the Orpheus page.
Quickstart
curl https://api.inferenceapis.com/v1/audio/speech \
-H "Authorization: Bearer $INFERENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "hexgrad/Kokoro-82M", "voice": "af_heart", "input": "The quick brown fox jumps over the lazy dog, and then it stops to enjoy the afternoon sun.", "response_format": "mp3"}' \
--output english.mp3import os
from openai import OpenAI
client = OpenAI(base_url="https://api.inferenceapis.com/v1", api_key=os.environ["INFERENCE_API_KEY"])
audio = client.audio.speech.create(model="hexgrad/Kokoro-82M", voice="af_heart", input="The quick brown fox jumps over the lazy dog, and then it stops to enjoy the afternoon sun.")
audio.write_to_file("english.mp3")Notes for English
- American (
af_,am_) and British (bf_,bm_) voices. English is Kokoro's strongest language; most of its training audio was English. - OpenAI voice names such as
alloyandnovaare accepted and mapped to the Kokoro voice of the same name, so OpenAI speech code runs unchanged. - Numbers, dates and abbreviations are read as written. Spell out anything that must be pronounced a specific way.
- Pacing follows punctuation; there is no SSML.
speedchanges the overall rate.
Cost and limits
Kokoro is billed at $5.20 per million Unicode characters of input. The 90-character sample above is 5.7 seconds of audio and costs $0.00047; at that rate an hour of English speech is about 57,000 characters, or roughly $0.30. A request accepts up to 20,000 characters; for longer text, split on sentence boundaries and join the audio. A paragraph returns in under a second in our measurement. Orpheus costs $19.50 per million characters and took about a minute for 300 characters, so render it ahead of time.
Other languages: Japanese · Chinese · Spanish · French · Hindi · Italian · Portuguese
Speech-to-text in English
The reverse direction: Whisper Large v3 transcribed our English test clips with 5.2% word error. See English speech-to-text.
