Text-to-Speech (TTS)
Text-to-Speech (TTS) converts written text into natural-sounding audio. The API returns a URL to the generated audio file and a task ID to monitor processing progress.
Endpoint for requesting text2audio inference
Text to be converted to speech
A beautiful sunset over mountains
The model to use for generation
kokoro
Name of the voice to be used during audio generation
af_sky
Language to be used during audio generation
en-us
Generated audio speech speed
1
Audio output format
flac
Sample rate of generated audio
24000
ID of the inference request.
Unauthorized user.
Unauthorized user.
POST /api/v1/client/txt2audio HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer JWT
Accept: application/json
Content-Type: application/json
Content-Length: 139
{
"text": "A beautiful sunset over mountains",
"model": "kokoro",
"voice": "af_sky",
"lang": "en-us",
"speed": 1,
"format": "flac",
"sample_rate": 24000
}
{
"data": {
"request_id": 1
}
}
Endpoint for calculating price for text2audio inference
Text to be converted to speech
A beautiful sunset over mountains
The model to use for generation
kokoro
Name of the voice to be used during audio generation
af_sky
Language to be used during audio generation
en-us
Generated audio speech speed
1
Audio output format
flac
Sample rate of generated audio
24000
Calculated price for text2img inference.
Unauthorized user.
Unauthorized user.
POST /api/v1/client/txt2audio/price-calculation HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer JWT
Accept: application/json
Content-Type: application/json
Content-Length: 139
{
"text": "A beautiful sunset over mountains",
"model": "kokoro",
"voice": "af_sky",
"lang": "en-us",
"speed": 1,
"format": "flac",
"sample_rate": 24000
}
{
"data": {
"price": 0.25
}
}
Last updated