Qaaf AI inside your own translation tool.
Translation one segment at a time inside Trados, OmegaT, Smartcat or your own code — and transcription of lectures, OCR of manuscripts and whole-book translation as file jobs, the same queue the site runs. Quran and Hadith stay in Arabic with the translation following. Inline tags come back exactly where they were. Terminology the way a scholar in the target language writes it.
Why 3× the site's price? The site is where the engine is cheapest, and the API is the way to use it from your own tools and your own workflow — segment by segment in a CAT tool, or files sent from a script overnight. Every file job tells you what it charged when it is accepted, so nothing is a surprise. The same file uploaded on the site costs a third.
Plug it into your tool
Add a provider of type OpenAI-compatible.
- Base URL
- https://qaafai.com/v1
- API key
- your key from above
- Model
- qaaf-translate
Older Trados: the "OpenAI Provider" app from the RWS AppStore takes the same three settings.
Any connector that accepts an OpenAI-compatible endpoint: enter the same base URL, key and model name. In the connector's prompt, say the languages — for example “Translate from English into Urdu.”
memoQ does not take a URL directly. Connect through Custom.MT or Intento, both of which have signed memoQ plugins and accept an OpenAI-compatible engine with the settings above. A native memoQ plugin is planned — tell us you want it.
One endpoint, segments in, segments out, with what it cost and what is left. Examples below. Any OpenAI client library also works against https://qaafai.com/v1.
Reference
Header Authorization: Bearer YOUR_KEY. Up to 100 segments and 30,000 characters per call, 60 calls a minute. Charged on source characters, only when a translation is returned.
curl https://qaafai.com/api/v1/translate \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": "English",
"target": "Urdu",
"segments": [
"The Prophet ﷺ said: {1}Actions are judged by intentions.{2}",
"See Sahih al-Bukhari, hadith 1."
]
}'
Returns:
{
"translations": ["...", "..."],
"source": "English", "target": "Urdu",
"characters": 93,
"credits_charged": 1,
"credits_remaining": 1857
}
| Field | Required | What it is |
|---|---|---|
| segments | yes | A list of strings, up to 100 and 30,000 characters per call. (text for a single string.) Empty ones come back unchanged, free. |
| target | yes | The language wanted — a name from /api/v1/languages, a code such as ur, or any language name you type. |
| source | no | The language of the text; auto (the default) detects it. |
| domain | no | islamic (default) or general. |
A multipart upload. The job is queued and runs on the same workers as the site; poll it, then download the Word file or read the text. Charged when the job is accepted, and the reply says how much.
| Field | Required | What it is |
|---|---|---|
| file | yes | Audio (mp3, wav, m4a, ogg), PDF, Word, or an image of a page (jpg, png, heic, tiff). |
| type | yes | transcription, translation or ocr (handwritten or scanned pages). |
| source | no | The language spoken or written. Pick one from /api/v1/languages or type any language name; leave it out for auto-detect. |
| target | translation: yes | The language wanted, from the list or typed. For a transcription, giving a target means “transcribe, then translate into this”; leave it out for a transcript in the original language. For OCR, leave it out to get the page as written. |
| pages | no | A range like 5-20 (or page_start and page_end) to process only those pages of a PDF or Word file. Whole file if omitted. |
| category | no | Islamic (default) or General. |
curl https://qaafai.com/api/v1/jobs -H "Authorization: Bearer YOUR_KEY" -F "type=transcription" -F "source=Urdu" -F "target=English" -F "file=@friday-bayan.mp3"
# → {"job_id": 512, "status": "queued", "credits_charged": 210, "poll": "/api/v1/jobs/512", ...}
curl https://qaafai.com/api/v1/jobs -H "Authorization: Bearer YOUR_KEY" -F "type=translation" -F "source=Arabic" -F "target=Urdu" -F "pages=1-25" -F "file=@kitab.pdf"
Then:
- GET /api/v1/jobs/{id} — status, progress, complete, failed. Poll every 30–60 seconds; a 100-page book takes 20–25 minutes.
- GET /api/v1/jobs/{id}/text — whatever has finished, as plain text (a transcript is usually read this way).
- GET /api/v1/jobs/{id}/download — the Word file; ?format=pdf for a PDF. While the job is still running this returns the finished sections.
- GET /api/v1/jobs — your recent jobs. GET /api/v1/languages — the names the site uses.
The OpenAI shape, for tools and libraries that already speak it. Model qaaf-translate. Say the languages in your prompt; the house rules are applied on top. Charged on the characters you send.
from openai import OpenAI
client = OpenAI(base_url="https://qaafai.com/v1", api_key="YOUR_KEY")
r = client.chat.completions.create(
model="qaaf-translate",
messages=[{"role": "user", "content": "Translate from Arabic into English:\nإنما الأعمال بالنيات"}],
)
print(r.choices[0].message.content)
Calls, characters and credits by day for the last 30 (?days=90 for more); and the key's name, credits left, price and limits.
Errors come as {"error": {"message", "type"}} with the HTTP status: 401 bad key, 402 out of credits, 429 too fast, 400 too big or malformed, 502 the engine failed (nothing charged).
The rules the engine follows
- One translation per segment, in order — never merged, split or dropped.
- Every inline tag and placeholder ({1}, <g id="1">, %s, {{name}}) is preserved, untranslated, in the position the target language needs.
- Quranic verses and the Arabic of a hadith stay in Arabic, letter for letter, with the translation after them. Scripture is never paraphrased.
- Terminology and honorifics the way a scholar writing in the target language uses them.
- Numbers, citations, footnote markers and names stay intact; names are transliterated the target language's conventional way.
- Nothing is charged for a call that fails.
Buying credits for the API
The API uses the same credits as everything else here. Buy a package on the billing page — bank transfer, JazzCash or NayaPay, confirmed on WhatsApp — and the credits are available to your key the moment they are added. Agencies and institutions that want monthly billing: message us and we set it up by hand.
Talk to us on WhatsApp