Felo API PlatformFelo API Platform
v0.4.0
OpenAPI 3.1.0

文字轉語音

伺服器:https://openapi.felo.ai
用戶端程式庫

Audio

​

文字轉語音

​

Use model to select the speech generation model. Channel selection is unavailable for speech generation requests.

請求本文
必填
application/json
  • input
    類型: string
    最小長度:  
    1
    最大長度:  
    4096
    必填
  • model
    類型: string
    最大長度:  
    256
    必填
  • response_format
    類型: string 列舉
    值
    • pcm
    • mp3
  • speed
    類型: number

    Currently only 1 is supported.

  • voice
    類型: string
    最小長度:  
    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.

回應
  • 200
    類型: string 格式: binary

    成功回傳音訊位元組: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 依可信上游成本與發布的加價、折扣結算。

Request Example for post/api/v1/audio/speech
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
Generate speech

需要協助嗎?