v1

latestOpenAPI 3.0.02026-07-228239173.7 KB
Client API

Endpoint for calculating price for text2audio inference. Either text or count_text must be provided.

post/api/v1/client/txt2audio/price-calculation

Headers

Accept'application/json' required

Request body

textstring nullable

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

count_textinteger nullable

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

modelstring required

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

mode'custom_voice' | 'voice_clone' | 'voice_design' nullable

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

voicestring nullable

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

langstring required

Language to be used during audio generation

speednumber required

Generated audio speech speed

formatstring required

Audio output format

sample_ratenumber required

Sample rate of generated audio

instructstring nullable

Natural language voice description for voice_design mode price calculation.

Example request

{
  "text": "A beautiful sunset over mountains",
  "count_text": 1000,
  "model": "Kokoro",
  "mode": "custom_voice",
  "voice": "af_sky",
  "lang": "en-us",
  "speed": 1,
  "format": "mp3",
  "sample_rate": 24000
}

Response

Calculated price for text2audio inference.

Example response

{
  "data": {
    "price": 0.25
  }
}