Skip to content
صوتك عربي

Beta

API documentation

Arabic voice API quickstart

Create an API key, choose a voice and make your first Arabic text-to-speech request with Python, Node.js or curl.
Browse documentation

From account to first request

  1. Create an account, then create an API key in the dashboard. Store it on your server, never in browser code or your repository. API keys
  2. Choose a voice from the catalogue. The example uses an available public voice ID when one exists; you can replace it with your own. Voice catalogue
  3. For Python install the openai package with pip install openai; for Node.js use npm install openai. Replace the placeholder key before sending the request.
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.pcm

The output is raw PCM, not a WAV file. See the streaming guide for playback. Requests require available credit; authentication can succeed while generation is unavailable.

Run the example and listen

Choose one example above. Run curl in your terminal, or save the Python example as speech.py and run python speech.py. For Node.js, save it as speech.mjs and run node speech.mjs; the example uses ES modules and top-level await.

After a successful request, speech.pcm appears in the directory where you ran the example. If FFmpeg is installed, play it with the following command. These examples use the default output rate of 24,000 Hz.

ffplay -f s16le -ar 24000 -ac 1 speech.pcm

If the request fails

Check the HTTP status: 401 means a key problem, 402 means insufficient credit, and 404 means the voice is missing or unavailable to your account. For 429 or 503, wait before retrying and increase the delay between attempts. Do not mistake an existing file from an earlier request for new output.

صوتك عربي

Arabic voices for your projects and transcription for your recordings, in one platform.

Company

© ⁦2026⁩ Sawtak Arabi · Beta