<commit_before>.. _sec-api-server:

******************
Server information
******************

.. http:get:: /api/server

   Retrieve information regarding server status. Returns a JSON object with two keys, ``version`` containing
   the server version and ``safe_mode`` containing one of ``settings``, ``incomplete_startup`` or ``flag``
   to indicate the reason the server is running in safe mode, or the boolean value of ``false`` if it's not
   running in safe mode.

   **Example Request**

   .. sourcecode:: http

      GET /api/server HTTP/1.1
      Host: example.com
      X-Api-Key: abcdef...

   **Example Response**

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
        "server": "1.5.0",
        "safe_mode": "incomplete_startup"
      }<commit_msg>📝 Add version info<commit_after>.. _sec-api-server:

******************
Server information
******************

.. http:get:: /api/server

   .. versionadded:: 1.5.0

   Retrieve information regarding server status. Returns a JSON object with two keys, ``version`` containing
   the server version and ``safe_mode`` containing one of ``settings``, ``incomplete_startup`` or ``flag``
   to indicate the reason the server is running in safe mode, or the boolean value of ``false`` if it's not
   running in safe mode.

   **Example Request**

   .. sourcecode:: http

      GET /api/server HTTP/1.1
      Host: example.com
      X-Api-Key: abcdef...

   **Example Response**

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
        "server": "1.5.0",
        "safe_mode": "incomplete_startup"
      }
{'fraction_non_alphanumeric': 0.16050878255602666, 'fraction_numerical': 0.013930950938824955, 'mean_word_length': 2.8329466357308584, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7348479', 'n_tokens_mistral': 496, 'n_tokens_neox': 469, 'n_words': 165}