Beta
Arabic text-to-speech API
Browse documentation
Text to Speech
POST /v1/audio/speech
modelstringUse arabic tts with OpenAI SDKs.
inputstringThe text to speak. Billed per character.
voicestringA voice id from your Voices page. Omit it for the default zero-shot voice.
response_formatstringMust be "pcm". Raw 16-bit mono PCM is the only format we emit.
sample_ratenumberOptional output rate from 8000 to 48000 Hz. Defaults to 24000 Hz.
| Field | Type | Notes |
|---|---|---|
| model | string | Use arabic tts with OpenAI SDKs. |
| input | string | The text to speak. Billed per character. |
| voice | string | A voice id from your Voices page. Omit it for the default zero-shot voice. |
| response_format | string | Must be "pcm". Raw 16-bit mono PCM is the only format we emit. |
| sample_rate | number | Optional output rate from 8000 to 48000 Hz. Defaults to 24000 Hz. |
curl --fail --show-error https://api.sawtakarabi.ai/v1/audio/speech \
-H "Authorization: Bearer sk_ar_live_..." \
-H "Content-Type: application/json" \
-d '{"model":"arabic tts","input":"مرحبا بك","voice":"9287b630-bc5f-574d-8c38-5f525c2b4ca3","response_format":"pcm"}' \
--output speech.pcmThe response body is raw little-endian 16-bit mono PCM, with no WAV header. The rate it was actually emitted at comes back on X-Sample-Rate; read that header rather than assuming a rate, or the audio plays at the wrong speed with no error anywhere.