基本使用方式
{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 ) |
使用例
レスポンス
- レスポンス本文はbinary audio fileとして返され、基本フォーマットは
wav
output_format=mp3
をクエリパラメータとして渡すとmp3形式でもレスポンス可能X-Audio-Length
ヘッダーを通じて音声の長さ(秒)を確認可能
注意事項
text
の長さが300文字を超過すると400エラーが発生します。style
がない場合でも呼び出し可能ですが、キャラクターによってdefault styleが異なる可能性があるため、Get Voices APIを呼び出してデフォルトスタイルを確認してください(スタイル配列の最初の値がデフォルト)。- レスポンスの音声ファイルは直接保存または再生できます(クライアントに応じて適切な処理が必要)。
Headers
API key for the service
Choose TTS engine: "supercage" or "torchserve"
Path Parameters
Query Parameters
The desired output format of the audio file (wav, mp3). Default is wav.
Available options:
wav
, mp3
Body
application/json
The text to convert to speech
Maximum length:
300
The language code of the text
Available options:
en
, ko
, ja
The style of character to use for the text-to-speech conversion
The model type to use for the text-to-speech conversion
The desired output format of the audio file (wav, mp3). Default is wav.
Available options:
wav
, mp3
Response
Audio file converted from text. The response includes an X-Audio-Length header with the duration in seconds.
The response is of type file
.