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避免把 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按可信上游成本及发布的加价、折扣结算。
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