Skip to main content
POST
/
v1
/
predict-duration
/
{voice_id}
Predict text-to-speech duration
curl --request POST \
  --url https://supertoneapi.com/v1/predict-duration/{voice_id} \
  --header 'Content-Type: application/json' \
  --header 'x-sup-api-key: <api-key>' \
  --data '
{
  "text": "<string>",
  "style": "<string>",
  "model": "sona_speech_1",
  "output_format": "wav",
  "voice_settings": {
    "pitch_shift": 0,
    "pitch_variance": 1,
    "speed": 1,
    "duration": 0,
    "similarity": 3,
    "text_guidance": 1,
    "subharmonic_amplitude_control": 1
  }
}
'
{
  "duration": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.supertoneapi.com/llms.txt

Use this file to discover all available pages before exploring further.

이 문서는 영어 원문을 기반으로 자동 번역되었습니다. 표현이 어색하거나 모호한 부분이 있을 수 있으니, 정확한 내용은 영어 원문을 함께 확인해 주세요.
주어진 입력으로 생성될 음성의 예상 길이(초)를 반환합니다. 비용 예측, UI 힌트 표시, 배치 작업 사전 점검에 유용합니다.
이 엔드포인트는 크레딧을 소비하지 않습니다. 동일한 300자 제한이 적용되며, 자동 청크 분할은 수행하지 않습니다.

엔드포인트

POST https://supertoneapi.com/v1/predict-duration/{voice_id}

경로 파라미터

NameRequiredDescription
voice_id대상 보이스의 ID입니다.

요청 본문

Create speech와 동일한 구조입니다 — text, language, style, model, voice_settings — 단, 길이에 영향을 주지 않는 output_format, include_phonemes, normalized_text는 제외됩니다.
NameRequiredDescription
text분석할 텍스트입니다. 최대 300자.
language언어 코드입니다. 보이스와 모델이 모두 지원해야 합니다.
style감정 스타일입니다. 기본값은 보이스의 첫 번째 스타일입니다.
modelTTS 모델입니다. 기본값은 sona_speech_1.
voice_settingsspeedduration을 통해 길이에 영향을 미칩니다. 전체 표는 Create speech를 참고해 주십시오.

요청 예시

POST /v1/predict-duration/20160a4c5ba38967330c84
x-sup-api-key: $SUPERTONE_API_KEY
Content-Type: application/json

{
  "text": "This is a long-form sentence for duration prediction.",
  "language": "en",
  "style": "neutral"
}

응답

{
  "duration": 3.57
}
길이는 초 단위 float 값으로 반환됩니다.

참고사항

  • 예측 시점과 실제 create_speech 호출 시점에 동일한 modelspeed를 사용해 주십시오 — 두 값 모두 결과에 영향을 미칩니다. 서로 다른 속도로 예측하고 생성하면 길이가 일치하지 않습니다.
  • 크레딧은 차감되지 않습니다. UI 힌트나 예산 사전 점검 용도로 안전하게 사용할 수 있습니다.

함께 보기

Docs: Cost and usage

예측과 예산 책정에 predict_duration을 활용하는 방법입니다.

Create speech

추정치를 검증한 뒤 실제로 오디오를 생성합니다.

Authorizations

x-sup-api-key
string
header
required

Path Parameters

voice_id
string
required

Body

application/json
text
string
required

The text to convert to speech. Max length is 300 characters.

Maximum string length: 300
language
enum<string>
required

Language code of the voice

Available options:
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
style
string

The style of character to use for the text-to-speech conversion

model
enum<string>
default:sona_speech_1

The model type to use for the text-to-speech conversion

Available options:
sona_speech_1,
sona_speech_2,
sona_speech_2_flash,
supertonic_api_1,
supertonic_api_3
output_format
enum<string>
default:wav

The desired output format of the audio file (wav, mp3). Default is wav.

Available options:
wav,
mp3
voice_settings
object

Response

Returns predicted duration of the audio in seconds

duration
number