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

Authorization
string
header
required

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
voiceId
string

The voice id taken from the paly ground TTS voice dropdown component on the dashboard

text
string

The text you want to convert to speech. Minimum 5 words text to speech content!

webhookUrl
string

The webhook url to which the TTS job result will be sent.

webhookAuth
object

Authorization header to be sent in this format: Authorization: [authKey] [authSecret]

Response

200
application/json
Successful response
success
boolean
default:
false
message
string
default:
success
data
object