Introduction
Rafiq answers questions about Islam from a corpus of Qur'an, hadith, tafsir, and scholarly fatwas — and cites what it used. This API gives you the same engine that powers rafiqai.app.
The one thing to understand first
This is not a chat completion API. Rafiq does not answer from a model's
memory. Every ruling it states comes from a retrieved scholarly document, and when the corpus
holds nothing that answers your question, it declines — deliberately, and with
answered: false.
That is a correct outcome, not a failure. If you retry on it you will loop forever. Handle it the way you would handle a search that found nothing.
What you can build
- A question-and-answer feature inside a masjid or Islamic-education app
- Prayer times and Hijri dates without maintaining your own calculation code
- Qur'an text lookup by verse or range
- A da'wah assistant for engaging people exploring Islam
Base URL
https://api.rafiqai.app/v1
Your first call
Every request needs an API key. Create one in your dashboard — it takes about a minute and needs a Nizam account.
curl https://api.rafiqai.app/v1/me \
-H "Authorization: Bearer rk_live_your_key_here"
If that returns your account and your remaining quota, everything is wired up correctly. Then ask something:
curl https://api.rafiqai.app/v1/chat \
-H "Authorization: Bearer rk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{"message": "What breaks wudu?"}'
Principles worth knowing
| Principle | What it means for you |
|---|---|
| Grounded, not generative | Answers come from retrieved documents. Sources are returned with every answer. |
| It abstains | answered: false is normal. Show it to your user; do not retry. |
| It does not issue new rulings | Rafiq reports what scholars have said. It does not perform ijtihad, and it will decline rather than derive. |
| Answers vary | The prose is generated, so identical questions differ in wording between calls. The rulings and sources do not. |