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: <x-sup-api-key>' \
  --data '{
  "text": "<string>",
  "language": "en",
  "style": "<string>",
  "model": "sona_speech_1",
  "output_format": "wav",
  "voice_settings": {
    "pitch_shift": 0,
    "pitch_variance": 1,
    "speed": 1
  }
}'
This response does not have an example.
입력한 텍스트를 오디오 스트림 형태로 반환하는 Streaming TTS(Text-to-Speech) API입니다.

기본 사용 방식

  • {voice_id}: 캐릭터 단위의 ID만 사용 가능
  • language, style, model 등의 파라미터는 Request Body에 포함됩니다

Request Body 항목 설명

항목필수설명
text변환할 텍스트. 최대 300자까지 입력 가능
language텍스트의 언어. ko, en, ja 중 하나
style감정 스타일. 예: neutral, happy, sad 등. 지정하지 않으면 해당 캐릭터의 기본 스타일이 적용됨
model사용 모델. 기본값은 sona_speech_1. 현재는 이 모델만 사용 가능
voice_settings음정/속도 조절. pitch_shift, pitch_variance, speed 필드 포함 (기본값: 0, 1, 1)
output_format원하는 음원 파일 형식. wav 또는 mp3. (기본값: wav)

사용 예시

POST /v1/text-to-speech/{voice_id}/stream
Content-Type: application/json
x-sup-api-key: [YOUR_API_KEY]

{
  "text": "Thank you for calling.",
  "language": "en",
  "style": "happy",
  "model": "sona_speech_1",
  "voice_settings": {
    "pitch_shift": 0,
    "pitch_variance": 1,
    "speed": 1
  }
}

응답

  • 응답 본문은 binary chunk으로 반환되며, 기본 포맷은 wav
  • output_format=mp3를 쿼리 파라미터로 전달하면 mp3 형식으로도 응답 가능

유의사항

  • text 길이는 300자 초과 시 400 오류가 발생합니다.
  • style이 없는 경우에도 호출 가능하지만, 캐릭터에 따라 default style이 다를 수 있어 Get Voices API를 호출해 디폴트 스타일을 확인해주세요(스타일 배열 중 처음 오는 값이 디폴트).
  • 응답의 음성 파일은 직접 저장하거나 재생할 수 있습니다 (클라이언트에 따라 적절한 처리 필요).

Headers

x-sup-api-key
string
required

API key for the service

Path Parameters

voice_id
string
required

Query Parameters

output_format
enum<string>
default:wav

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

Available options:
wav,
mp3

Body

application/json

Response

200
audio/wav

Streaming audio data in binary format

The response is of type file.