Using the CatéGPT API

    You can interact with the API through HTTP requests from any programming language.

    Endpoint URL

    https://categpt.chat/api/question

    Authentication

    The CatéGPT API uses API keys for authentication. Contact us to get one and use it in your requests.

    All requests must include your API key in an HTTP header Authorization as shown below:

    Authorization: CATEGPT_API_KEY

    Request Parameters

    Name Type Description
    question
    Optional
    string

    Ask your question here. It can be a question you formulate in a sentence or a simple word on a theme you would like to address.

    If you do not provide this parameter, the algorithm will choose a question for you randomly.

    Making a Request

    You can paste the command below into your terminal to launch your first API request. Make sure to replace $CATEGPT_API_KEY with your secret API key.

    curl https://categpt.chat/api/question \
      -X POST \
      -H "Content-Type: application/json" \
      -H "Authorization: $CATEGPT_API_KEY" \
      -d '{
        "question": "How to pray?"
      }'

    This request asks CatéGPT the question about prayer, and it will attempt to respond by quoting Scriptures and Church teachings.

    Example Response

    You should receive a response that looks like the following:

    {
      "stat": "ok",
      "question": "How to pray?",
      "reponses": [
        {
          "type": "Introduction",
          "text": "Prayer is an act of communication with God. It is a means of drawing closer to God, praising Him, expressing our needs, offering our gratitude, and seeking His will. The Catholic Church encourages its faithful to pray regularly and offers various forms of prayer such as vocal prayers, meditation, contemplation, spiritual reading, and liturgical prayer."
        },
        {
          "type": "In the Scriptures",
          "text": "The Bible encourages us to pray without ceasing (1 Thessalonians 5:17), and Jesus Himself teaches us how to pray with the Our Father (Matthew 6:9-13). In the Gospel of Luke, Jesus also taught on the importance of perseverance in prayer (Luke 11:5-13) and humility in prayer (Luke 18:9-14). The Bible also shows many examples of prayers from saints and prophets that can serve as models for our own prayer."
        },
        {
          "type": "The Fathers and Doctors of the Church",
          "text": "The Church Fathers developed a rich tradition of prayer. They emphasized the importance of prayer as a means of communing with God and growing spiritually. St. Augustine wrote about the importance of prayer in his famous quote: \"Our hearts are restless until they rest in You, Lord.\" St. John Chrysostom stressed the need for fervent and persevering prayer to obtain divine graces."
        },
        {
          "type": "In the Magisterium",
          "text": "The Catechism of the Catholic Church teaches that prayer is the foundation of all spiritual life (CCC 2558) and that prayer unites us to God in a special way (CCC 2565). The Magisterium of the Church encourages the faithful to develop a regular life of prayer and to participate in the Church's liturgical prayer."
        },
        {
          "type": "What the Popes have said",
          "text": "Popes have regularly spoken about the importance of prayer in their teachings. For example, Pope John Paul II wrote in his encyclical 'Redemptor Hominis': \"Prayer is a vital and organic reality of the believer at the level of his relationship with God, and vice versa.\" Pope Benedict XVI emphasized the importance of prayer in his encyclical 'Deus Caritas Est': \"To pray means to live in the presence of God, it means to live in life and love of God.\""
        }
      ],
      "references": [
        {
          "description": "1 Thessalonians 5:17",
          "url": "https://www.vatican.va/archive/bible/nova_vulgata/documents/nova-vulgata_nt_epist-i-thessalonicenses_lt.html"
        },
        {
          "description": "Matthew 6:9-13",
          "url": "https://www.vatican.va/archive/bible/nova_vulgata/documents/nova-vulgata_nt_evang-matthaeum_lt.html"
        },
        {
          "description": "Luke 11:5-13",
          "url": "https://www.vatican.va/archive/bible/nova_vulgata/documents/nova-vulgata_nt_evang-lucam_lt.html"
        },
        {
          "description": "Luke 18:9-14",
          "url": "https://www.vatican.va/archive/bible/nova_vulgata/documents/nova-vulgata_nt_evang-lucam_lt.html"
        },
        {
          "description": "Catechism of the Catholic Church 2558",
          "url": "https://www.vatican.va/archive/FRA0013/__P8U.HTM"
        },
        {
          "description": "Catechism of the Catholic Church 2565",
          "url": "https://www.vatican.va/archive/FRA0013/__P8U.HTM"
        },
        {
          "description": "Encyclical 'Redemptor Hominis' - John Paul II",
          "url": "https://www.vatican.va/content/john-paul-ii/fr/encyclicals/documents/hf_jp-ii_enc_04031979_redemptor-hominis.html"
        },
        {
          "description": "Encyclical 'Deus Caritas Est' - Benedict XVI",
          "url": "https://www.vatican.va/content/benedict-xvi/fr/encyclicals/documents/hf_ben-xvi_enc_20051225_deus-caritas-est.html"
        }
      ]
    }

    Now you have generated the first Catholic response to your question.

    Response Parameters

    Name Type Description
    stat
    Default
    string

    The status of the response. If it is ok, it means the response to your question was generated successfully.

    question
    Default
    string

    The question that was asked. It is possible that what you requested has been rephrased as a question. In case you did not ask any specific question, you will find here the question that was chosen.

    reponses
    Default
    array

    The different responses to the question that was asked. There are five different types of responses. Each of these responses is provided with:

    • type: the description of the given response type. It can be a general introduction, a response from the Scriptures, the Fathers and Doctors of the Church, the Magisterium, or specifically what the popes have said or written.
    • text: the text of the response to the question, according to the chosen type.
    references
    Default
    array

    A list of sources used to formulate the responses. These sources are limited to the fundamental texts of the Church: the Old and New Testaments, the Catechism of the Catholic Church, the Councils, and the texts from different pontificates. Each of these references contains:

    • description: the source in text form.
    • url: a link to the cited source. This parameter may remain empty.