UtilitiesPopular

Translation API

AI-powered translation across 22 languages using Google Gemini 2.5 Flash. Features Arabic transliteration (romanization), auto-detection, formal/informal register, and 24-hour intelligent caching via Valkey.

Endpoint:/v1/translate
Methods:GETPOST
Latency:~500ms (AI) / ~5ms (cached)

Try it out

POST/v1/translate

Parameters

Code

curl
curl -X POST "https://khaleejiapi.dev/api/v1/translate?text=Hello%2C%20how%20are%20you%3F&source=auto&target=ar&formality=formal" \
-H "X-API-Key: your_api_key"

Methods

GET — Language Info

Returns the list of 22 supported languages with codes, names, and RTL flags. No parameters needed.

POST — Translate Text

Translate text between languages. Submit the text, source, target, and formality in the request body.

POST Request Body

FieldTypeRequiredDescription
textstringRequiredText to translate (max 5000 characters)
sourcestringOptionalSource language code or 'auto' for detection
targetstringOptionalTarget language code (22 supported)
formalitystringOptionalRegister: 'formal' or 'informal'

Supported Languages

Arabic (ar)English (en)French (fr)Spanish (es)German (de)Turkish (tr)Urdu (ur)Persian (fa)Hindi (hi)Chinese (zh)Japanese (ja)Korean (ko)Russian (ru)Portuguese (pt)Italian (it)Dutch (nl)Polish (pl)Indonesian (id)Malay (ms)Swahili (sw)Hebrew (he)Bengali (bn)

RTL languages: Arabic, Urdu, Persian, Hebrew

Response Fields

translatedText

The translated text result

transliteration

Arabic romanization (when source or target is Arabic)

confidence

Translation confidence score (0–1)

cached

Whether the result came from the 24-hour cache

Rate Limits

PlanRequests/MonthRate Limit
Free5005 req/min
Starter5,00030 req/min
Professional50,000120 req/min
Business250,000500 req/min