Skip to main content
POST
/
api
/
v1
/
client
/
txt2audio
/
price-calculation
cURL
curl --request POST \
  --url https://api.deapi.ai/api/v1/client/txt2audio/price-calculation \
  --header 'Accept: <accept>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "Kokoro",
  "voice": "af_sky",
  "lang": "en-us",
  "speed": 1,
  "format": "flac",
  "sample_rate": 24000,
  "text": "A beautiful sunset over mountains",
  "count_text": 1000
}
'
{
  "data": {
    "price": 0.25
  }
}

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. Either text or count_text must be provided.

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

text
string | null

Text to be converted to speech. Either this or count_text must be provided.

Example:

"A beautiful sunset over mountains"

count_text
integer | null

Number of characters for price calculation. Either this or text must be provided.

Example:

1000

Response

Calculated price for text2img inference.

data
object