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",
  "lang": "en-us",
  "speed": 1,
  "format": "flac",
  "sample_rate": 24000,
  "text": "A beautiful sunset over mountains",
  "count_text": 1000,
  "mode": "custom_voice",
  "voice": "af_sky",
  "instruct": "<string>"
}
'
{
  "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. Voice is optional (not needed for voice_clone or voice_design modes).

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"

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

mode
enum<string> | null

TTS mode: custom_voice (default), voice_clone, or voice_design.

Available options:
custom_voice,
voice_clone,
voice_design
Example:

"custom_voice"

voice
string | null

Name of the voice to be used. Only relevant for custom_voice mode.

Example:

"af_sky"

instruct
string | null

Natural language voice description for voice_design mode price calculation.

Response

Calculated price for text2audio inference.

data
object