Skip to main content
POST
/
v1
/
text-to-speech
/
{voice_id}
Convert text to speech
curl --request POST \
  --url https://supertoneapi.com/v1/text-to-speech/{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
  },
  "include_phonemes": false,
  "normalized_text": "<string>"
}
'
"<string>"
このドキュメントは英語の原文から自動翻訳されています。表現に不自然な箇所がある場合があります。正確な内容は英語の原文もあわせてご確認ください。
テキストから音声を生成し、レスポンスボディとしてオーディオを返します。コンセプトの解説、SDK サンプル、Tips については Docs: 音声生成 をご参照ください。

エンドポイント

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

パスパラメータ

NameRequiredDescription
voice_id対象ボイスの ID です。

リクエストボディ

NameRequiredDescription
text変換対象のテキストです。最大 300 文字。 より長い入力には SDK の利用、またはクライアント側での分割をご検討ください。
language言語コード(例: enkoja)です。ボイスとモデルの両方でサポートされている必要があります。
style感情スタイル(例: neutralhappy)です。未指定の場合はボイスのデフォルトスタイルが適用されます。
modelTTS モデルです。デフォルトは sona_speech_1
output_formatwav(デフォルト)または mp3
voice_settings高度なボイスパラメータです(下記参照)。
include_phonemestrue の場合、レスポンスは Base64 オーディオと音素タイミングデータを含む JSON に切り替わります。デフォルト: false
normalized_text発音正規化された補助テキストです(sona_speech_2 および sona_speech_2_flash で使用され、主に日本語向け)。

モデル別対応言語

ModelLanguages
sona_speech_2, sona_speech_2_flashen, ko, ja, bg, cs, da, el, es, et, fi, hu, it, nl, pl, pt, ro, ar, de, fr, hi, id, ru, vi
supertonic_api_3en, ko, ja, ar, bg, cs, da, de, el, es, et, fi, fr, hi, hr, hu, id, it, lt, lv, nl, pl, pt, ro, ru, sk, sl, sv, tr, uk, vi
supertonic_api_1en, ko, ja, es, pt
sona_speech_1en, ko, ja

ボイス設定

サポートされていない設定は警告なく無視されます(エラーにはなりません)。
NameRangeDefaultDescription
pitch_shift-24 → 240半音(semitone)単位のピッチ調整です。
pitch_variance0 → 21ピッチ変動の度合いです。
speed0.5 → 21再生レートの倍率です。duration の後に適用されます。
duration0 → 600非ゼロを指定すると、その長さ(秒)に合わせて音声を生成します。
similarity1 → 53生成音声が元のキャラクターボイスにどれだけ近いかを制御します。
text_guidance0 → 41入力テキストの内容に対して発話特性がどの程度敏感に適応するかを制御します。
subharmonic_amplitude_control0 → 21生成音声のサブハーモニック振幅量を制御します。

モデル別のボイス設定

Settingsona_speech_2sona_speech_2_flashsupertonic_api_3supertonic_api_1sona_speech_1
pitch_shift, pitch_variance, duration
speed
similarity, text_guidance
subharmonic_amplitude_control

レスポンス

デフォルト(include_phonemes=false): ボディにバイナリオーディオを返します。
  • Content-Type: audio/wav または audio/mpegoutput_format に対応)。
  • X-Audio-Length ヘッダー: 生成音声の長さ(秒)です。
include_phonemes=true の場合: Base64 オーディオと音素配列を含む JSON ボディです。
{
  "audio_base64": "UklGRnoGAABXQVZF...",
  "phonemes": {
    "symbols": ["", "h", "ɐ", "ɡ", "ʌ", ""],
    "start_times_seconds": [0, 0.092, 0.197, 0.255, 0.29, 0.58],
    "durations_seconds": [0.092, 0.104, 0.058, 0.034, 0.29, 0.162]
  }
}

注意事項

  • text が 300 文字を超えると 400 を返します。自動チャンキングには Python または TypeScript SDK をご利用いただくか、手動で分割してください(長文 を参照)。
  • speedduration の後に適用されます。duration=5speed=2 を指定すると、約 10 秒のオーディオが生成されます。
  • style を省略した場合は、ボイスの styles 配列の最初の値が使用されます。デフォルトはボイスごとに異なる場合があるため、ボイス取得 で確認してください。

関連項目

Docs: Create speech

SDK サンプル付きの解説。

Stream 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

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

Returns either binary audio or JSON with phoneme data based on include_phonemes parameter

Binary audio file (when include_phonemes=false or omitted)