API Documentation
SDK Documentation
Voice Enablement
Transcription Routes
Text to Speech Routes
Real Time Routes
Twilio Phone Numbers Routes
Voice Agents Routes
Voice Agents Conversations Routes
AI Content Routes
Project Routes
API Statistics Routes
Text to Speech Routes
Generate Text to Speech Route
POST
/
v1
/
jobs
/
text-to-speech
curl --request POST \
--url https://api.tryhamsa.com/v1/jobs/text-to-speech \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"voiceId": "<string>",
"text": "Minimum 5 words text to speech content!",
"webhookUrl": "<string>",
"webhookAuth": {
"authKey": "Token",
"authSecret": "Secret"
}
}'
{
"success": false,
"message": "success",
"data": {
"id": "<string>",
"title": "<string>",
"type": "AI_CONTENT",
"mediaUrl": "<string>",
"webhookUrl": "<string>",
"model": "<string>",
"status": "PENDING",
"jobResponse": {
"text": "<string>",
"ttsMediaFile": "<string>"
},
"totalCost": 123,
"apiKeyId": "<string>",
"userId": "<string>",
"ttsVoiceId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
Authorizations
Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token <api-key>'
Body
application/json
Response
200
application/json
Successful response
The response is of type object
.
curl --request POST \
--url https://api.tryhamsa.com/v1/jobs/text-to-speech \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"voiceId": "<string>",
"text": "Minimum 5 words text to speech content!",
"webhookUrl": "<string>",
"webhookAuth": {
"authKey": "Token",
"authSecret": "Secret"
}
}'
{
"success": false,
"message": "success",
"data": {
"id": "<string>",
"title": "<string>",
"type": "AI_CONTENT",
"mediaUrl": "<string>",
"webhookUrl": "<string>",
"model": "<string>",
"status": "PENDING",
"jobResponse": {
"text": "<string>",
"ttsMediaFile": "<string>"
},
"totalCost": 123,
"apiKeyId": "<string>",
"userId": "<string>",
"ttsVoiceId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
Assistant
Responses are generated using AI and may contain mistakes.