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
application/jsonPossible values: Text to be converted to speech
A beautiful sunset over mountainsThe model to use for speech generation. Available models can be retrieved via the GET /api/v1/client/models endpoint.
KokoroName of the voice to be used during audio generation
af_skyLanguage to be used during audio generation
en-usGenerated audio speech speed
1Audio output format
flacSample rate of generated audio
24000ID of the inference request.
Unauthorized user.
Unauthorized user.
POST /api/v1/client/txt2audio HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer YOUR_SECRET_TOKEN
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": "c08a339c-73e5-4d67-a4d5-231302fbff9a"
}
}Endpoint for calculating price for text2audio inference. Either text or count_text must be provided.
application/jsonPossible values: Text to be converted to speech. Either this or count_text must be provided.
A beautiful sunset over mountainsNumber of characters for price calculation. Either this or text must be provided.
1000The model to use for speech generation. Available models can be retrieved via the GET /api/v1/client/models endpoint.
KokoroName of the voice to be used during audio generation
af_skyLanguage to be used during audio generation
en-usGenerated audio speech speed
1Audio output format
flacSample rate of generated audio
24000Calculated price for text2img inference.
Unauthorized user.
Unauthorized user.
POST /api/v1/client/txt2audio/price-calculation HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: application/json
Content-Type: application/json
Content-Length: 157
{
"text": "A beautiful sunset over mountains",
"count_text": 1000,
"model": "Kokoro",
"voice": "af_sky",
"lang": "en-us",
"speed": 1,
"format": "flac",
"sample_rate": 24000
}{
"data": {
"price": 0.25
}
}Last updated