Spanish text-to-speech
Spanish: 3 Kokoro 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: “Hoy hace muy buen tiempo, así que por la tarde voy a pasear por el parque con unos amigos.”
| Listen | Voice id | Voice | Round-trip check |
|---|---|---|---|
| Female | All 19 words understood | ||
| Male | All 19 words understood | ||
| Male | All 19 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.
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": "ef_dora", "input": "Hoy hace muy buen tiempo, así que por la tarde voy a pasear por el parque con unos amigos.", "response_format": "mp3"}' \
--output spanish.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="ef_dora", input="Hoy hace muy buen tiempo, así que por la tarde voy a pasear por el parque con unos amigos.")
audio.write_to_file("spanish.mp3")Notes for Spanish
- The voices carry no regional label. Listen to the samples to judge the accent for your audience.
- 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.2 seconds of audio and costs $0.00047; at that rate an hour of Spanish speech is about 62,000 characters, or roughly $0.32. 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 is English-only, so Spanish always uses Kokoro.
Other languages: English · Japanese · Chinese · French · Hindi · Italian · Portuguese
Speech-to-text in Spanish
The reverse direction: Whisper Large v3 transcribed our Spanish test clips with 2.7% word error. See Spanish speech-to-text.
