API Reference

Complete endpoint documentation with request/response examples.

POST

/tts

Generate speech from text

Request Body

{
"text": "Hello world",
"voice": "af_heart",
"format": "mp3",
"speed": 1.0
}

Parameters

text *required

Text to synthesize. Max 5000 characters.

voice *required

Voice ID (af_heart, am_michael, bf_emma, am_adam)

format optional

Audio format: mp3, wav, ogg. Default: mp3

speed optional

Playback speed (0.5 - 2.0). Default: 1.0

Response

{
"status": "success",
"url": "https://cdn.speekoapp.com/audio/xxx.mp3",
"duration": 5.2,
"cost": 0.00012
}
POST

/tts-video

Generate video from text with voice

Request Body

{
"text": "Subscribe to our channel",
"voice": "af_heart",
"resolution": "1080p",
"aspect_ratio": "16:9",
"subtitles": true
}

Parameters

text *required

Text to convert to video

voice *required

Voice ID for audio track

resolution optional

1080p or 720p. Default: 1080p

aspect_ratio optional

16:9, 9:16, or 1:1. Default: 16:9

Response

{
"status": "success",
"url": "https://cdn.speekoapp.com/video/xxx.mp4",
"duration": 30,
"cost": 1.35
}