API Reference
Text to speech
POST
/
v1
/
audio
/
speech
Text to speech
curl --request POST \
--url https://api.synapsai.cloud/v1/audio/speech \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"language": "<string>",
"response_format": "mp3",
"speed": 1,
"stream_format": "audio"
}
'import requests
url = "https://api.synapsai.cloud/v1/audio/speech"
payload = {
"input": "<string>",
"language": "<string>",
"response_format": "mp3",
"speed": 1,
"stream_format": "audio"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)"<string>"Body
application/json
Request body for text-to-speech conversion.
Text to convert into speech. Required.
Optional language code to control language/voice selection.
Desired audio format for the returned speech.
Available options:
mp3, wav, opus, flac, aac Playback speed multiplier for the generated speech (1.0 = normal).
Whether the response will be streamed as SSE or returned as raw audio.
Available options:
sse, audio Response
Audio bytes in requested response_format
The response is of type file.
⌘I
Text to speech
curl --request POST \
--url https://api.synapsai.cloud/v1/audio/speech \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"language": "<string>",
"response_format": "mp3",
"speed": 1,
"stream_format": "audio"
}
'import requests
url = "https://api.synapsai.cloud/v1/audio/speech"
payload = {
"input": "<string>",
"language": "<string>",
"response_format": "mp3",
"speed": 1,
"stream_format": "audio"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)"<string>"