The engine behind rafiqai.app, as an API. Ask a question about Islam and get an answer grounded in the Qur'an, hadith and the rulings of scholars — with the sources it used.
curl https://api.rafiqai.app/v1/chat \
-H "Authorization: Bearer rk_live_..." \
-H "Content-Type: application/json" \
-d '{"message": "Can I combine prayers while travelling?"}'
import { Rafiq } from "rafiq-sdk";
const rafiq = new Rafiq();
const res = await rafiq.ask({
message: "Can I combine prayers while travelling?"
});
if (res.answered) console.log(res.answer.summary);from rafiq import Rafiq
rafiq = Rafiq()
res = rafiq.ask(
message="Can I combine prayers while travelling?"
)
if res.answered:
print(res.answer.summary)Typed SDKs for TypeScript and Python — they handle retries, tell the two rate limits apart, and will not let you read an answer without checking whether there was one.
Rafiq is not a chat completion API, and it does not answer from a model's memory. Every ruling it states comes from a retrieved scholarly document — and when nothing in the corpus answers your question, it says so.
{
"answered": false,
"answer": {
"summary": "I couldn't find
anything on this."
},
"sources": []
}{
"answered": true,
"intent": "applied_fiqh",
"answer": { "summary": "..." },
"sources": [
{ "title": "...", "url": "..." }
]
}An abstention is a correct outcome, not a failure. Show it the way you would show a search that found nothing — if you retry on it, you will loop forever.
One answers questions. The rest are deterministic reference data — no model call, no retrieval, and safe to cache hard.
Retrieval runs across the whole library on every question, and a cross-encoder reranks what survives. The documents behind an answer come back with it.
Rafiq reports what the scholars ruled. It does not perform ijtihad, and it will decline rather than derive a ruling of its own.
A masjid app or an Islamic-education product, answering from scholarship rather than from a general model.
Without maintaining astronomical code or a calendar table of your own.
Uthmani script by verse or range, for a reader, a widget or a memorisation tool.
A separate corpus and a different voice, for someone exploring Islam or working through a doubt.
Sign in with your Nizam account, create a key, and you are calling it a minute later. Every response tells you exactly where you stand.
| Plan | Per minute | Per month |
|---|---|---|
| Free | 30 requests | 5,000 calls |
| Partner | 120 requests | 100,000 calls |
Your own 4xx errors do
not count against the quota — getting a parameter wrong while you are building should not
cost you anything. If you are building something useful and need more, ask.
A Nizam account is all you need. The documentation is open, so read it first if you would rather look before signing in.