Skip to main content
Send text, get back a WAV file of it spoken aloud. These endpoints let you create speech from your own systems, and list, fetch and delete the audio you’ve made.

Authentication

Send your API key in the X-API-KEY header on every request, to the base URL https://api-eg.olimi.ai. See API Authentication. You only ever see the audio that belongs to the company your API key is issued to.

How it works

Creating audio runs in the background:
  1. Create: Create audio returns straight away with status: "pending".
  2. Poll: call Get audio every few seconds until status is completed or failed.
  3. Download: once it’s completed, download the file from attachment.url. The link expires after one hour; call Get audio again for a fresh one.

Choosing a voice and language

A request needs a languageId and a voiceId. Fetch them once and cache them; they don’t change.
  1. Language: list the languages available for speech, with List languages. It needs no API key.
  2. Voice: list the voices for the language you picked, with List voices.
Pairing a voice with a language it isn’t valid for returns voice_language_not_compatible.
Being listed is not a guarantee that a voice works. A voice whose engine is unavailable is still listed, and its audio ends up failed. Test the voices you plan to use with a short phrase, and keep a fallback voice.

Audio fields

Responses also carry internal fields. They may change without notice, so rely only on the fields listed on this page.

Status values

Attachment object

Audio format

The file is a WAV (RIFF/WAVE) holding signed 16-bit little-endian PCM, mono. The sample rate varies by voice, because different voices run on different engines. You’ll see 24,000 Hz or 16,000 Hz. Don’t hard-code it; read it from the WAV header, which every audio library does for you:

Tips

  • Normalise numbers before sending. Spell out digits, currencies, dates and phone numbers as words ("1234" → "ألف ومتين أربعة وتلاتين"). Written-out Arabic is pronounced far more reliably than raw numerals.
  • Split long text. Send sentences or paragraphs rather than whole documents. Shorter requests finish faster and fail less often.
  • Sanity-check duration. Compare it with what you’d expect for the length of your text. A wildly different value means that request went wrong; delete it and create it again.

Errors

Always branch on statusCode first. Most errors also carry a machine-readable errorCode:
If the engine behind a voice fails, you don’t get an error. The audio’s status becomes failed instead. Validation errors (422) have a different body. message is a list of what went wrong, and there’s no errorCode:
The message text is for humans and may change, so don’t match on it.