Skip to main content
POST
/
v1
/
text-to-speech
/
{voice_id}
/
stream
Convert text to speech with streaming response
curl --request POST \
  --url https://supertoneapi.com/v1/text-to-speech/{voice_id}/stream \
  --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
  },
  "include_phonemes": false,
  "normalized_text": "<string>"
}
'
"<string>"
이 문서는 영어 원문을 기반으로 자동 번역되었습니다. 표현이 어색하거나 모호한 부분이 있을 수 있으니, 정확한 내용은 영어 원문을 함께 확인해 주세요.
생성된 음성을 청크 단위로 스트리밍 반환하여 전체 클립이 준비되기 전부터 재생을 시작할 수 있습니다. 스트리밍과 빠른 비스트리밍 모델 중 어느 것을 선택할지에 대해서는 Docs: Stream speech지연시간 최적화를 참고해 주십시오.
스트리밍은 현재 **sona_speech_1**에서만 지원됩니다.

엔드포인트

POST https://supertoneapi.com/v1/text-to-speech/{voice_id}/stream

경로 파라미터

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

요청 본문

Content-Type: application/json
NameRequiredDescription
text변환할 텍스트입니다. 최대 300자.
language언어 코드입니다. 지원: en, ko, ja.
style감정 스타일입니다(예: neutral, happy). 생략하면 보이스의 기본 스타일이 적용됩니다.
model반드시 sona_speech_1이어야 합니다(스트리밍을 지원하는 유일한 모델입니다).
output_formatwav(기본값) 또는 mp3.
voice_settings고급 보이스 파라미터입니다 — 필드와 범위는 Create speech와 동일합니다.
include_phonemestrue이면 청크별 음소 데이터를 포함한 NDJSON으로 응답됩니다. 기본값은 false.

응답

기본값 (include_phonemes=false): 바이너리 오디오 스트림입니다.
  • Content-Type: audio/wav 또는 audio/mpeg(output_format에 따름).
  • 첫 번째 청크에는 오디오 파일 헤더가 포함되며, 이후 청크는 원시 오디오 데이터입니다.
include_phonemes=true일 때: 줄바꿈으로 구분된 JSON(NDJSON), 청크당 하나의 객체:
{"audio_base64":"...","phonemes":{"symbols":["","h"],"start_times_seconds":[0,0.05],"durations_seconds":[0.05,0.08]}}
{"audio_base64":"...","phonemes":{"symbols":["ɐ","ɡ"],"start_times_seconds":[0.13,0.19],"durations_seconds":[0.06,0.04]}}

참고사항

  • Stream speech는 현재 베타이며 sona_speech_1만 지원합니다.
  • text가 300자를 초과하면 400을 반환합니다. SDK는 더 긴 입력을 자동으로 청크 분할하여 이터레이터로 전달합니다.
  • speedduration 이후에 적용됩니다(예: duration=5 + speed=2 ≈ 10초).
  • style을 생략하면 보이스의 기본 스타일이 사용됩니다. 기본값은 Get voice로 확인해 주십시오.

함께 보기

Docs: Stream speech

스트리밍을 사용할 시점과 SDK별 청크 소비 방법입니다.

LLM streaming TTS

OpenAI 및 Anthropic과의 엔드 투 엔드 레시피입니다.

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

Maximum string length: 300
language
enum<string>
required

The language code of the text

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
include_phonemes
boolean
default:false

Return phoneme timing data with the audio

normalized_text
string

Pre-normalized text for TTS. Only used with sona_speech_2 and sona_speech_2_flash models.

Response

Streaming audio data in binary format or NDJSON format with phoneme data based on includePhonemes parameter

Binary audio stream (when includePhonemes=false or omitted)