Skip to main content

Audio

Text-to-speech for long content, voice and voice style (optional).

Request

POSThttps://api.fliki.ai/v1/generate/audio

Headers

{
"Content-type": "application/json",
"Authorization": "Bearer API_KEY"
}
KeyValueDescription
Content-Typeapplication/jsonSpecifies that the request body format is JSON, allowing the server to parse the data correctly.
AuthorizationBearer YOUR_API_KEYGenerate your API Key in the account/api. section and replace YOUR_API_KEY with your actual key.

Body

{
"webhook": String,
"content": String,
"voiceId": String,
"voiceStyleId": String | null,
"playbackRate": Number,
"format": "mp3" | "wav" | "ogg",
"pronunciations": Array<{ original: String, replace: String }> | undefined
}
KeyTypeDescriptionRequiredDefault
contentstringThe content to be converted, typically text. Must not exceed the 10000 character limit.YesN/A
voiceIdstringThe identifier for the voice to be used for the output.YesN/A
voiceStyleIdstringThe identifier for the style of the voice.-N/A
playbackRatenumberThe playback rate for the audio. Must be between 0.5 and 2.0.-1.0
formatstringThe format of the audio file. Must be one of "mp3", "wav", or "ogg".-"mp3"
pronunciationsarrayAn optional array of objects containing original and replace strings for pronunciation adjustments.-N/A
webhookstringThe webhook is a public URL from your server that Fliki will call after your content has been generated. It should be a POST method endpoint to receive responses.-N/A

Obtain voiceId and voiceStyleId via the voices endpoint.

Response

{
"fileId": String
}
KeyTypeDescription
fileIdstringUnique identifier of the file created

Example

cURL Request
curl \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"content": "...", "voiceId": "...", "voiceStyleId": "..."}' \
-X POST https://api.fliki.ai/v1/generate/audio