Beta
API reference
Base URL and authentication
Every request carries an API key as a bearer token. Create an account to get one; it comes with $5 of credit and needs no card. The speech and transcription API endpoints require a valid API key.
https://api.sawtakarabi.ai/v1 Authorization: Bearer sk_ar_live_...
The speech and transcription endpoints are OpenAI-compatible. Point an official OpenAI SDK’s baseURL here and use your Sawtak Arabi key.
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.
Speech to Text
POST /v1/audio/transcriptions
modelstringUse arabic asr. Required by OpenAI SDKs.
filemultipartAudio or video file. The complete multipart upload must fit within 25 MB.
response_formatstringOptional: json (default, recommended) or text. verbose_json is also accepted but does not add word or segment timestamps.
languagestringOptional BCP-47 language code. Defaults to ar.
temperaturenumberOptional sampling temperature. Defaults to 0.
| Field | Type | Notes |
|---|---|---|
| model | string | Use arabic asr. Required by OpenAI SDKs. |
| file | multipart | Audio or video file. The complete multipart upload must fit within 25 MB. |
| response_format | string | Optional: json (default, recommended) or text. verbose_json is also accepted but does not add word or segment timestamps. |
| language | string | Optional BCP-47 language code. Defaults to ar. |
| temperature | number | Optional sampling temperature. Defaults to 0. |
Prepare a recording with clear Arabic speech. Replace meeting.wav in the example with your local file path. Upload the file as multipart form data; do not send a JSON body or manually set the multipart boundary.
curl --fail --show-error https://api.sawtakarabi.ai/v1/audio/transcriptions \ -H "Authorization: Bearer sk_ar_live_..." \ -F model="arabic asr" \ -F [email protected] \ -F response_format=json
Example JSON response
{
"text": "النص المكتوب",
"usage": { "type": "duration", "seconds": 42 }
}Transcription is charged after the audio is processed, on usage.seconds, because the duration is not knowable until the file is decoded. Your balance has to cover the longest the upload could be before the request starts.
The json response includes the transcript in text and usage when supplied by the transcription service. With response_format=text, the body is plain text and has no usage object. Neither format provides speaker labels or word timestamps.
Review names, numbers and specialist terms before publishing or using a transcript in an important workflow. Audio quality, overlapping speakers and mixed languages can affect the result.
Voices
Browse the Voices page, open a voice and copy its Voice ID. Pass that exact value as voice; the display name and dialect label are not identifiers.
Your API key can use voices owned by its account and voices published for public use. Knowing a private voice ID does not grant access. A deleted, unavailable or unauthorized voice returns an error; the API does not silently substitute another voice.
To create a voice from your recording, follow the voice cloning guide. Once encoding finishes, use the new voice ID in the same speech request.
Limits
requests600 / minDefault per account, shared across its API keys.
concurrency5Default simultaneous in-flight requests per account.
upload25 MBMaximum transcription request body, including multipart overhead.
| Field | Type | Notes |
|---|---|---|
| requests | 600 / min | Default per account, shared across its API keys. |
| concurrency | 5 | Default simultaneous in-flight requests per account. |
| upload | 25 MB | Maximum transcription request body, including multipart overhead. |
Errors
Read the HTTP status first. Gateway errors normally include a JSON detail message, X-Error-Code for the machine-readable reason, and X-Request-Id to identify the request. Errors from a proxy or interrupted connection may not include these fields.
| Status | Meaning |
|---|---|
| 400 | Malformed body, unsupported response_format, or an unusable voice value. |
| 401 | Missing, revoked or unrecognised API key. |
| 402 | Not enough prepaid balance for the request. |
| 404 | The voice id does not exist or is not available to your account. |
| 413 | The request body exceeds the endpoint limit. Reduce the upload or input size before retrying. |
| 429 | Rate limit or concurrency limit. Retry with backoff. |
| 502 | The gateway could not complete the request with the speech service. Wait before retrying. |
| 503 | No capacity right now. Retry shortly. |
We refund requests that fail on our side before producing audio. Invalid options and unavailable voices are rejected before charging. A backend rejection of your request after charging, a client disconnect, or a partially delivered stream is not refunded.
Fix input, credentials or balance before retrying 400, 401, 402, 404 or 413 responses. For 429, 502 or 503, retry a limited number of times with increasing delays. Avoid parallel retry loops. If a connection breaks after submission, the outcome can be uncertain; another request can generate and charge again.
When contacting support, include the request ID, endpoint, HTTP status and approximate time. Do not include your API key or the recording itself.
What it costs
- Text to Speech
- $50 / 1M characters
- Speech to Text
- $0.50 / hour of audio
Prepaid. At a zero balance, paid API requests and calls stop rather than running up an invoice. start with free credit to resume.