Skip to main content
POST
Text To Speech Stream

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

xi-api-key
string | null
x-api-key
string | null

Path Parameters

voice_id
string
required

Query Parameters

output_format
string | null

Body

application/json
text
string
required

Text to convert to speech

Example:

"I'm beginnin' to feel like a Rap God, Rap God\nAll my people from the front to the back nod, back nod\nNow, who thinks their arms are long enough to slap box, slap box?\nThey said I rap like a robot, so call me Rap-bot"

model_id
string
default:hexgrad/Kokoro-82M

Model ID to use for the conversion

output_format
enum<string>
default:wav

Output format for the speech

Available options:
mp3,
opus,
flac,
wav,
pcm
Examples:

"mp3"

"opus"

"flac"

"wav"

"pcm"

language_code
string | null

ISO 639-1, 2 letter language code

Response

Successful Response