Skip to main content
POST
/
api
/
v1
/
client
/
txt2audio
cURL
curl --request POST \
  --url https://api.deapi.ai/api/v1/client/txt2audio \
  --header 'Accept: <accept>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "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"
  }
}
Prerequisite: To ensure a successful request, you must first consult the Model Selection endpoint to identify a valid model slug, check specific limits and features, and verify LoRA availability.

Authorizations

Authorization
string
header
required

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

Headers

Accept
enum<string>
default:application/json
required
Available options:
application/json

Body

application/json

Audio generation parameters

text
string
required

Text to be converted to speech

Example:

"A beautiful sunset over mountains"

model
string
required

The model to use for speech generation. Available models can be retrieved via the GET /api/v1/client/models endpoint.

Example:

"Kokoro"

voice
string
required

Name of the voice to be used during audio generation

Example:

"af_sky"

lang
string
required

Language to be used during audio generation

Example:

"en-us"

speed
number
required

Generated audio speech speed

Example:

1

format
string
required

Audio output format

Example:

"flac"

sample_rate
number
required

Sample rate of generated audio

Example:

24000

Response

ID of the inference request.

data
object

Information from success endpoint