跳转到主要内容
POST
/
text-to-audio
This response does not have an example.

Authorizations

Authorization
string
header
required

API-Key 鉴权。所有 API 请求都应在 Authorization HTTP Header 中包含你的 API-Key,格式为 Bearer {API_KEY}强烈建议开发者把 API-Key 放在后端存储,而非分享或者放在客户端存储,以免 API-Key 泄露,导致财产损失。

Body

application/json

文字转语音请求体。

user
string
required

用户标识,应用内唯一。

message_id
string<uuid>

Dify 生成的消息 ID(优先使用)。

text
string

语音生成内容(若无 message_id)。

streaming
boolean
default:false

是否流式返回音频。

Response

语音文件生成成功。

生成的 WAV 格式音频文件。