Lahja is an OpenAI-compatible API with an Arabic mode. Name the dialect in the model string and replies come back in Gulf, Egyptian, Levantine or Maghrebi Arabic instead of textbook formal Arabic.
google/gemma-4-31b-it:arabic-gulfSame model and same API. Arabic mode is the suffix.
One sentence, six ways. One meaning for the model.
فصحى · Formal≈335M, learnedyouكم تكلفة الإفطار؟
🇲🇦 Rabat≈31Myouشحال كا يدير الفطور؟
🇹🇳 Tunis≈12.5Myouبقداش فطور الصباح؟
🇪🇬 Cairo≈84Myouبكام الفطار؟
🇱🇧 Beirut≈60Myouأدي حق الترويقة؟
🇶🇦 Doha≈11Myouبكم الريوق؟
One meaning
“How much is breakfast?”
Arabic mode answers in yours
🇶🇦Gulf Arabic خليجي
“How much is breakfast?” كم تكلفة الإفطار؟ (Formal Arabic). شحال كا يدير الفطور؟ (Rabat). بقداش فطور الصباح؟ (Tunis). بكام الفطار؟ (Cairo). أدي حق الترويقة؟ (Beirut). بكم الريوق؟ (Doha). Arabic mode answers in the user's own variety, here Gulf Arabic.
“It's too expensive. I can't buy it.” إنها غالية الثمن. لا أستطيع شرائها. (Formal Arabic). هادشي غالي بزاف. مانقدرش نشريه. (Rabat). غالية برشة. منجمش نشريها. (Tunis). ده غالي قوي. مقدرش أشتريه. (Cairo). كتير غالي. ما بقدر إشتري. (Beirut). هذي واجد غالي. ماقدر اشتريه. (Doha). Arabic mode answers in the user's own variety, here Egyptian Arabic.
“Please change my seat.” من فضلك غير مقعدي. (Formal Arabic). عافاك بدل بلاصتي. (Rabat). أمان بدلي بلاصتي. (Tunis). لو سمحت غيرلى الكرسى بتاعى. (Cairo). إزا بتريد غيرلي مأعدي. (Beirut). لو سمحت غير كرسيي. (Doha). Arabic mode answers in the user's own variety, here Levantine Arabic.
“Which bus do I take to the station?” أية حافلة يجب أن آخذ إلى المحطة؟ (Formal Arabic). اينا طوبس كايدي لا غار خاصني نشد؟ (Rabat). شنيا الكار إلي يلزمني ناخوها باش نمشي للمحطة؟ (Tunis). انه اوتوبيس مفروض أخده للمحطة؟ (Cairo). اي باص لازم اخد لروح عالمحطة؟ (Beirut). اي باص اخذ حق اروح المحطة؟ (Doha). Arabic mode answers in the user's own variety, here Maghrebi Arabic.
“I didn't make a reservation.” لم أقم بالحجز. (Formal Arabic). مادرتش الحجز. (Rabat). معملتش حجز. (Tunis). أنا ماحجزتش. (Cairo). ما حجزت. (Beirut). ما سويت حجز. (Doha). Arabic mode answers in the user's own variety, here Formal Arabic.
Each line is the same sentence, written by native translators for the MADAR corpus (CAMeL Lab, NYU Abu Dhabi). A city stands for its region: Doha for the Gulf, Beirut for the Levant, Rabat and Tunis for the Maghreb. Speaker counts are first-language estimates from Wikipedia, citing Ethnologue. The Gulf figure covers Gulf Arabic proper, not Najdi or Hejazi. Formal Arabic is learned at school and is nobody's first language.
Plain
The reply most apps get today shows up here.
Arabic mode
The same model with Arabic mode on shows up here.
Get a key
Free trial: 1 million tokens, no card. Your key shows up on this page right away. Nothing is charged without your OK. See pricing.
Your key
We show it once. Copy it now and keep it somewhere safe.
Quickstart
Any OpenAI SDK works. Change the base URL and the key.
Pick the dialect with the suffix: :arabic-gulf, -egy, -lev, -mag or -msa. If you don't know your users' dialect, :arabic detects it per message. Telling us is more accurate.
Streaming and tool calls work as usual.
The first call after a quiet spell can take about 5–6 minutes while the model starts. You get a 503 with Retry-After. Retry and it answers.
Same message, both ways
Scores
Replies in the user's own dialectplain → Arabic mode
Share of 40 native-written messages per dialect whose reply came back in that same dialect, as judged blind. Formal Arabic is left out here: a correct formal reply is the default, so there is nothing to switch.
Every model, every variety
Each model twice: plain, and with Arabic mode on. Dialect columns are 1–5. "In dialect" is the share of dialect messages answered in that dialect rather than formal Arabic.
How we measured
Messages: 40 sentences per variety from the MADAR corpus (CAMeL Lab, NYU Abu Dhabi), written by native translators for Rabat, Cairo, Beirut, Doha and Modern Standard Arabic. Each variety uses different sentences.
Grading: Claude Opus 5.5 scored every reply blind on three 1–5 scales (dialect match, fluency, helpfulness) and labelled its language. No human ratings yet. Native-speaker review is next.