Skip to main content
POST
/
v1
/
jobs
/
text-to-speech
Initiate a text to speech job
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": "أهلاً و سهلاً بكم في همسة!",
  "webhookUrl": "<string>",
  "webhookAuth": {
    "authKey": "Token",
    "authSecret": "Secret"
  }
}
'
{
  "success": false,
  "message": "success",
  "data": {
    "id": "<string>",
    "title": "<string>",
    "mediaUrl": "<string>",
    "webhookUrl": "<string>",
    "model": "<string>",
    "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"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.tryhamsa.com/llms.txt

Use this file to discover all available pages before exploring further.

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 '

Body

application/json
voiceId
string

The voice id you wish to use. If you are using a cloned voice, you need to preload it first using preload cloned TTS voice API

text
string

The text you want to convert to speech.

Example:

"أهلاً و سهلاً بكم في همسة!"

webhookUrl
string<uri>

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

Successful response

success
boolean
default:false
message
string
default:success
data
object