CatéGPT
Documentación

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.

ℹ️
The liturgical calendar APIs are free and keyless — only answer generation, described here, needs a key. To add the chat to a website without coding, use the widget and the plugins instead.

Base URL

https://categpt.chat

Authentication

The API authenticates with an API key (Bearer token).

  1. Create an account at https://categpt.chat.
  2. Open the Developer page of your account.
  3. Generate an API key (cgpt_live_…). It is shown only once — copy it immediately.
  4. Send it in the Authorization header.
Authorization: Bearer cgpt_live_yourKey
⚠️
Never expose your secret key in the browser or a public repository. Treat it like a password. The “try it” console on this page keeps your key in your browser only (localStorage) — it travels only inside the call itself, exactly as with 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)

FieldTypeRequiredDescription
questionstringyesThe question (1 to 4000 chars).
modestringnoquick (default) or academic.
levelstringnochild, teen, catechesis, general (default), academic, priest.
languagestringno2-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"
  }'
POST/api/v1/answerProbar

Generate 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"}'
Introduce tu clave API para enviar.

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"
}
KeyDescription
answerThe answer, with its numbered [1], [2]… markers.
referencesThe references, in marker order: source type, title, citation, URL, verified (the link was checked) and language.
usageTokens consumed and the debited amount (billed_usd).
languageEffective 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_…
FieldTypeRequiredDescription
questionstringyesThe question (1 to 4000 chars).
datestringnoDay YYYY-MM-DD (default: today, UTC).
localestringnoAnswer language (fr, en…). Auto-detected otherwise.
modestringnoquick (default) or academic.
levelstringnoSame 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"
  }'
POST/api/v1/feast/askProbar

Ask 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"}'
Introduce tu clave API para enviar.

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 codeerror.codeMeaning
400invalid_requestMalformed request.
401invalid_api_keyMissing or invalid key.
402insufficient_creditsCredit balance depleted (the response carries balance).
429rate_limitedToo many requests.
502upstream_errorUpstream 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.

💡
Best practices. Cache frequent answers, handle 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

Go further

Keyed API — sourced answers · CatéGPT