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>",
"voice": "<string>",
"instructions": "<string>",
"ref_audio": "<string>",
"ref_text": "<string>",
"x_vector_only_mode": true,
"language": "<string>",
"sample_rate": 123,
"max_new_tokens": 2,
"stream": false,
"response_format": "mp3",
"speed": 1,
"stream_format": "audio"
}
'import requests
url = "https://api.synapsai.cloud/v1/audio/speech"
payload = {
"input": "<string>",
"voice": "<string>",
"instructions": "<string>",
"ref_audio": "<string>",
"ref_text": "<string>",
"x_vector_only_mode": True,
"language": "<string>",
"sample_rate": 123,
"max_new_tokens": 2,
"stream": False,
"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.
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>",
"voice": "<string>",
"instructions": "<string>",
"ref_audio": "<string>",
"ref_text": "<string>",
"x_vector_only_mode": true,
"language": "<string>",
"sample_rate": 123,
"max_new_tokens": 2,
"stream": false,
"response_format": "mp3",
"speed": 1,
"stream_format": "audio"
}
'import requests
url = "https://api.synapsai.cloud/v1/audio/speech"
payload = {
"input": "<string>",
"voice": "<string>",
"instructions": "<string>",
"ref_audio": "<string>",
"ref_text": "<string>",
"x_vector_only_mode": True,
"language": "<string>",
"sample_rate": 123,
"max_new_tokens": 2,
"stream": False,
"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>"