v1

latestOpenAPI 3.0.1MIT2026-07-26104203277.0 KB

Preview TTS voice

Generate a short preview clip for a TTS voice.

post/v2/tts/voices/preview

Query parameters

projectIdstring required
Example:ae6d58c6-c6bd-4ae0-ad74-b8b39c29928b

Project identifier.

Request body

audioUrlstring uri required

URL of the uploaded voice sample

audioTranscriptionstring required

Transcription of the uploaded audio sample

language'en' | 'ar' required

Language of the preview voice

dialectIdstring uuid required

Dialect identifier (required for preview)

textstring required

Text to be synthesized using the preview voice

Example request

{
  "audioUrl": "https://cdn.tryhamsa.com/uploads/voice.wav",
  "audioTranscription": "مرحباً، هذا مثال على التسجيل الصوتي.",
  "language": "ar",
  "dialectId": "145a7af6-3614-4bb2-be5d-702000d459ab",
  "text": "أهلاً بك، هذا مثال لنطق الصوت."
}

Response

Preview generated successfully.

successboolean
messagestring
messageKeystring

Example response

{
  "success": true,
  "message": "Operation completed successfully",
  "messageKey": "OPERATION_SUCCESSFUL",
  "data": {
    "audioUrl": "https://cdn.tryhamsa.com/previews/preview.wav"
  }
}