Skip to content
POST
https://api.menavoice.ai/api/tts
Try it
curl -X POST https://api.menavoice.ai/api/tts \
  -H "x-api-key: $MENAVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "مرحباً بكم في مينا فويس",
    "voiceId": "layla",
    "quality": "flash",
    "dialectId": "msa"
  }'
{
  "audio": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYwLjE2LjEwMAAAAAAAAAAA...",
  "mimeType": "audio/mpeg",
  "voice": "layla",
  "characters": 23
}

Generates speech from text with a studio voice or a voice from your library. Send text for a single voice, or segments for a multi-speaker dialogue. The audio comes back base64-encoded in the JSON response.

Each request costs $25 per million characters of text, taken from your API credit.

Authorizations

x-api-keystringrequired

Your API key. See Authentication.

Body

application/json
textstringrequired

The text to speak, up to 5,000 characters. Required unless you send segments.

voiceIdstringdefault: layla

The voice. For studio voices, an ID such as layla, noura, ahmed or khaled (see Voices); an unknown ID falls back to layla. With quality set to clone, the ID of a voice in your voice library, which is then required.

qualityenum<string>default: flash

The model: flash (MenaVoice 1v), pro (MenaVoice 1.5), v2 (MenaVoice 2) or clone (MenaVoice Clone). An unknown value falls back to flash. See Models Overview.

dialectIdstring

Steers the delivery toward a dialect, such as egyptian, saudi, moroccan or msa. See the list of dialects. Unknown values are ignored, and so is this field with quality: "clone".

segmentsobject[]

A conversation to speak instead of text: up to 40 lines and 5,000 characters in total. Each line is spoken in its own voice, and the result is one MP3.

Show properties
textstringrequired

What this speaker says. Empty lines are skipped.

voiceIdstring

The voice for this line, as in the top-level voiceId.

dialectIdstring

The dialect for this line. Defaults to the top-level dialectId.

Response

application/json
audiostringrequired

The generated speech, base64-encoded.

mimeTypestringrequired

The audio format, audio/mpeg (MP3). Use it to choose a file extension or Content-Type.

voicestringrequired

The voice that spoke: a studio voice ID, or the name of a library voice. For a dialogue, every voice that spoke, separated by commas.

charactersnumberrequired

The number of characters billed: the length of text, or of all dialogue lines together.

Errors

StatusWhen
400text is missing or longer than 5,000 characters, segments is invalid or has more than 40 lines, or a clone voice isn't in your library.
401The API key is missing or invalid.
402Your API credit can't cover the request.
429More than 30 requests in a minute, or more requests at once than your concurrency allows.
502The voice engine didn't return audio. Retry.

See Errors for the exact messages.

Was this page helpful?