Skip to main content
POST
/
text-to-audio
This response does not have an example.

Authorizations

Authorization
string
header
required

API Key authentication. For all API requests, include your API Key in the Authorization HTTP Header, prefixed with 'Bearer '. Example: Authorization: Bearer {API_KEY}. Strongly recommend storing your API Key on the server-side, not shared or stored on the client-side, to avoid possible API-Key leakage that can lead to serious consequences.

Body

application/json

At least one of message_id or text must be provided, along with user.

user
string
required

The user identifier, defined by the developer, must ensure uniqueness within the app.

message_id
string<uuid>

For text messages generated by Dify, simply pass the generated message-id directly. The backend will use the message-id to look up the corresponding content and synthesize the voice information directly. If both message_id and text are provided simultaneously, the message_id is given priority.

text
string

Speech generated content. Used if message_id is not provided or not found.

Response

200 - audio/wav

Audio file generated successfully.

The generated audio file in WAV format.