---
title: "Predict text-to-speech duration"
method: POST
path: "/v1/predict-duration/{voice_id}"
tags: ["text_to_speech"]
---

# Predict text-to-speech duration

`POST /v1/predict-duration/{voice_id}`

Predict the duration of text-to-speech conversion without generating audio

## Path parameters

- `voice_id` string, required

## Request body

- PredictTTSDurationRequest
  - `text` string, required — The text to convert to speech. Max length is 300 characters.
  - `language` 'en' | 'ko' | 'ja' | 'bg' | 'cs' | 'da' | 'el' | 'es' | 'et' | 'fi' | 'hu' | 'it' | 'nl' | 'pl' | 'pt' | 'ro' | 'ar' | 'de' | 'fr' | 'hi' | 'id' | 'ru' | 'vi' | 'hr' | 'lt' | 'lv' | 'sk' | 'sl' | 'sv' | 'tr' | 'uk', required — Language code of the voice
  - `style` string — The style of character to use for the text-to-speech conversion
  - `model` 'sona_speech_1' | 'sona_speech_2' | 'sona_speech_2_flash' | 'supertonic_api_1' | 'supertonic_api_3' — The model type to use for the text-to-speech conversion
  - `output_format` 'wav' | 'mp3' — The desired output format of the audio file (wav, mp3). Default is wav.
  - `voice_settings` ConvertTextToSpeechParameters
    - `pitch_shift` number
    - `pitch_variance` number
    - `speed` number
    - `duration` number — Duration parameter for TTS generation
    - `similarity` number — Similarity parameter for voice matching
    - `text_guidance` number — Text guidance parameter for generation control
    - `subharmonic_amplitude_control` number — Subharmonic amplitude control parameter

## Response `200`

Returns predicted duration of the audio in seconds

- object
  - `duration` number

## Other responses

- `400` — Bad Request: Invalid request data for duration prediction or invalid request body/headers
- `401` — Unauthorized: Invalid API key
- `402` — Not Enough Credits
- `403` — Forbidden: Permission denied
- `404` — Not Found: Voice not found
- `408` — Request Timeout
- `429` — Rate Limit Exceeded
- `500` — Internal Server Error: Failed to convert text to speech

---

[API](https://skmtc.net/supertoneapi/apis/supertone-public-api.md) · [All operations](https://skmtc.net/supertoneapi/apis/supertone-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/supertoneapi/supertone-public-api/revisions/1ac6d0957e70/schema)
