Audio
文字轉語音
Use model to select the speech generation model. Channel selection is unavailable for speech generation requests.
- 類型: stringinput最小長度:1最大長度:4096必填
- 類型: stringmodel最大長度:256必填
- 類型: string 列舉response
_format 值- pcm
- mp3
- 類型: numberspeed
Currently only 1 is supported.
- 類型: stringvoice最小長度:1最大長度:256
Optional non-blank voice ID. The upstream model determines whether a voice is required and which IDs it accepts. Catalog voices are examples.
- 類型: string 格式: binary200
成功回傳音訊位元組:MP3 為
audio/mpeg,原始 PCM 為audio/pcm,不是 WAV、JSON 或 SSE。播放前確認 HTTP 狀態與傳輸完整;--fail避免把錯誤本文寫入音訊。中斷後丟棄不完整檔案。播放原始 PCM 需要通道的音訊參數,不可猜測。依通道計費:STT 使用
input_audio_second或 token;TTS 使用input_character。speech_billing_unit的utf16_code_unit和unicode_code_point對 emoji 計數不同。預占不是費用上限,結算可能非同步;缺少證據不代表免費。兩個介面都接受X-Felo-Channel,只向選定通道派發一次。逾時或斷線後不要自動重試,也應停用 SDK 重試;保留X-Request-Id及可用的X-Generation-Id供核對。Console Playground 尚未支援語音呼叫。configured_rates依凍結費率及可信用量結算;upstream_cost依可信上游成本與發布的加價、折扣結算。
curl https://openapi.felo.ai/api/v1/audio/speech \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"model": "",
"input": "",
"voice": "",
"response_format": "pcm",
"speed": 1
}'
@filename