Keyed API — sourced answers
The CatéGPT API generates sourced answers about the Catholic faith: every key statement links to a verified reference. Ideal for integrating the assistant into an application, a back-office or a bot.
Base URL
https://categpt.chat
Authentication
The API authenticates with an API key (Bearer token).
- Create an account at https://categpt.chat.
- Open the Developer page of your account.
- Generate an API key (
cgpt_live_…). It is shown only once — copy it immediately. - Send it in the
Authorizationheader.
Authorization: Bearer cgpt_live_yourKey
curl.Credits & billing
Usage is prepaid: top up your account, then each answer is debited. The
billed amount is the model cost times a multiplier (~2×) — it comes back in
usage.billed_usd of every response. An answer is generated only if the
balance is positive; otherwise the API answers 402 with your balance.
Generate an answer — POST /api/v1/answer
POST /api/v1/answer
Content-Type: application/json
Authorization: Bearer cgpt_live_…
Parameters (JSON body)
| Field | Type | Required | Description |
|---|---|---|---|
question | string | yes | The question (1 to 4000 chars). |
mode | string | no | quick (default) or academic. |
level | string | no | child, teen, catechesis, general (default), academic, priest. |
language | string | no | 2-letter language code (fr, en…). Auto-detected otherwise. |
Example request
curl -X POST https://categpt.chat/api/v1/answer \
-H "Authorization: Bearer cgpt_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"question": "What does the Catechism say about the Eucharist?",
"mode": "academic",
"level": "general"
}'
/api/v1/answerWypróbujGenerate a sourced answer to a free-form question.
curl -X POST "https://categpt.chat/api/v1/answer" \
-H "Authorization: Bearer cgpt_live_…" \
-H "Content-Type: application/json" \
-d '{"question":"Que dit le Catéchisme sur l’espérance ?","mode":"quick","level":"general"}'Response
{
"answer": "…text with [1], [2] markers…",
"references": [
{
"source_type": "catechism",
"title": "Catechism of the Catholic Church",
"citation": "CCC 1373-1377",
"url": "https://www.vatican.va/…",
"verified": true,
"language": "en"
}
],
"usage": { "prompt_tokens": 1234, "completion_tokens": 567, "billed_usd": 0.012 },
"language": "en"
}
| Key | Description |
|---|---|
answer | The answer, with its numbered [1], [2]… markers. |
references | The references, in marker order: source type, title, citation, URL, verified (the link was checked) and language. |
usage | Tokens consumed and the debited amount (billed_usd). |
language | Effective language of the answer. |
Source types (source_type)
bible, catechism, council, pontifical, canon_law,
social_doctrine, church_father, church_doctor, other.
Ask about the day's feast — POST /api/v1/feast/ask
Same authentication, same quotas and same billing as /api/v1/answer — but
the question is first enriched with the day's liturgical context (feast,
colour, readings, description — and, when the day has one, the Vetus Ordo
Missae feast with its class and the proper of its Mass, source
Divinum Officium), like the chat on the
“Saint of the day” page.
POST /api/v1/feast/ask
Content-Type: application/json
Authorization: Bearer cgpt_live_…
| Field | Type | Required | Description |
|---|---|---|---|
question | string | yes | The question (1 to 4000 chars). |
date | string | no | Day YYYY-MM-DD (default: today, UTC). |
locale | string | no | Answer language (fr, en…). Auto-detected otherwise. |
mode | string | no | quick (default) or academic. |
level | string | no | Same as /api/v1/answer. |
curl -X POST https://categpt.chat/api/v1/feast/ask \
-H "Authorization: Bearer cgpt_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"question": "Which saint is celebrated today, and why?",
"locale": "en"
}'
/api/v1/feast/askWypróbujAsk a question grounded in the feast of the day.
curl -X POST "https://categpt.chat/api/v1/feast/ask" \
-H "Authorization: Bearer cgpt_live_…" \
-H "Content-Type: application/json" \
-d '{"question":"Qui fête-t-on aujourd’hui et pourquoi ?","mode":"quick","level":"general"}'The response has the same format as /api/v1/answer (answer,
references, usage, language), plus the date of the liturgical
day that was used.
Examples
JavaScript (fetch)
const res = await fetch("https://categpt.chat/api/v1/answer", {
method: "POST",
headers: {
"Authorization": "Bearer cgpt_live_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({ question: "Who was Saint Augustine?" }),
});
const data = await res.json();
console.log(data.answer, data.references);
Python (requests)
import requests
r = requests.post(
"https://categpt.chat/api/v1/answer",
headers={"Authorization": "Bearer cgpt_live_xxx"},
json={"question": "Who was Saint Augustine?"},
)
data = r.json()
print(data["answer"])
Rate limits
Up to 60 requests per minute per key — a quota shared between
/api/v1/answer and /api/v1/feast/ask. Beyond that, the API returns
429.
Errors
| HTTP code | error.code | Meaning |
|---|---|---|
| 400 | invalid_request | Malformed request. |
| 401 | invalid_api_key | Missing or invalid key. |
| 402 | insufficient_credits | Credit balance depleted (the response carries balance). |
| 429 | rate_limited | Too many requests. |
| 502 | upstream_error | Upstream model error. |
Errors are returned as { "error": { "code": "…" } }.
A 502 upstream_error also carries a retryable boolean. It is true for a
transient cause — a rate limit, an upstream timeout — and false when the
failure needs a human on our side: retrying cannot succeed then, and an
immediate second attempt only adds noise. We do not disclose the cause itself.
402 by topping up credits, and always show the references next to the answer for transparency.OpenAPI specification
The whole API is described by an OpenAPI 3.1 specification, importable into Postman, Insomnia or a client generator:
https://categpt.chat/api/openapi