Skip to main content
POST
curl
Reads text aloud with one of the speech models. The audio is mono and 16-bit. The model names tts-1, tts-1-hd and gpt-4o-mini-tts all select kokoro-q8.

Voices

Kokoro voices: af_alloy, af_aoede, af_bella, af_heart, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky, am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck, am_santa, bf_alice, bf_emma, bf_isabella, bf_lily, bm_daniel, bm_fable, bm_george, bm_lewis. Both Kokoro models accept these OpenAI voice names. OmniVoice can design or clone a voice in the Voices studio on sharemy.ai. The API does not offer that yet.

Formats

The sample rate depends on the model. The X-Sample-Rate response header gives it in Hz. You need it to play pcm. Browsers can read this header across origins.

Price

Priced by the length of input, per 500 characters. See Credits and pricing.

Differences from OpenAI

  • response_format: only wav and pcm. mp3, opus, aac and flac are refused.
  • model defaults to kokoro-q8, and voice is optional.
  • Ignored: instructions, stream_format.
  • No streaming: the audio comes back whole.

Authorizations

Authorization
string
header
required

An API token from the account panel on sharemy.ai. Tokens start with smai_.

Body

application/json

Top-level null fields are treated as omitted.

input
string
required

The text to read, 1 to 4,096 characters.

Required string length: 1 - 4096
model
enum<string> | null
default:kokoro-q8

tts-1, tts-1-hd and gpt-4o-mini-tts select kokoro-q8.

Available options:
kokoro-q8,
kokoro-fp32,
supertonic,
omnivoice,
tts-1,
tts-1-hd,
gpt-4o-mini-tts,
null
voice
string | null

Kokoro accepts native ids and OpenAI names. alloy, echo, fable, onyx and nova map to af_alloy, am_echo, bm_fable, am_onyx and af_nova respectively. shimmer, ash, ballad, coral, sage and verse map to the default af_heart. Supertonic takes F1 to F5 or M1 to M5 and defaults to F1. OmniVoice ignores voice.

Example:

"af_heart"

speed
number | null
default:1
Required range: 0.5 <= x <= 2
response_format
enum<string> | null
default:wav

wav: a 16-bit mono WAV file. pcm: the same samples as raw signed 16-bit little-endian mono, with no header. mp3, opus, aac and flac are not offered.

Available options:
wav,
pcm,
null

Response

The audio. The X-Sample-Rate header gives its sample rate in Hz.

The response is of type file.