Inference API

The Inference API allows you to submit text and receive a likelihood score. Use the batch inference API if classifying several texts, as it is more efficient and allows for higher throughput.

POST https://api.checkfor.ai/v1/classify/text
Request JSON Object:
  • text (string) – The input text to classify.

Response JSON Object:
  • ai_likelihood (float) – The classification of the text, on a scale from 0.0 (human) to 1.0 (AI).

  • text (string) – The classified text.

  • prediction (string) – A string representing the classification.

Request Headers

{
  "Content-Type": "application/json",
  "x-api-key": "<api-key>"
}

Request Body

{
  "text": "<text>"
}

Example Request

POST https://api.checkfor.ai/v1/classify/text HTTP/1.1
Host: api.checkfor.ai
Content-Type: application/json
x-api-key: your_api_key_here

{
  "text": "The text to analyze"
}

Example Response

{
  "text": "The text to analyze",
  "prediction": "Likely AI",
  "ai_likelihood": 0.92
}
POST https://api.checkfor.ai/v1/classify/text/batch
Request JSON Object:
  • texts (array) – The input texts to classify.

Response JSON Object:
  • responses (array) – The classification results as a list, each item containing “text”, “ai_likelihood”, and “prediction”.

Batch Inference

Request Headers

{
  "Content-Type": "application/json",
  "x-api-key": "<api-key>"
}

Request Body

{
  "text": ["<text1>", "<text2>", "..."]
}

Example Request

POST https://api.checkfor.ai/v1/classify/text/batch HTTP/1.1
Host: api.checkfor.ai
Content-Type: application/json
x-api-key: your_api_key_here

{
  "text": ["The first text to analyze", "The second text to analyze"]
}

Example Response

{
  "responses": [
    {
      "text": "The first text to analyze",
      "prediction": "Likely AI",
      "ai_likelihood": 0.92
    },
    {
      "text": "The second text to analyze",
      "prediction": "Possibly AI",
      "ai_likelihood": 0.58
    }
  ]
}

Errors

The following error responses are possible:

  • 400 Bad Request - If the request body is not properly formatted.

  • 401 Unauthorized - If the x-api-key is missing or invalid.

  • 500 Internal Server Error - If there is an error processing the request.