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 避免把 HTTP 错误正文写进音频文件。断连可能留下不完整文件,应丢弃。播放裸 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

需要帮助?