Overview
The AI Detection feature of our API is a powerful tool designed to analyze text and predict whether it was generated by an AI, written by a human, or contains elements of both. It outputs the likelihood of each scenario as a percentage, providing valuable insights for content verification, authenticity checks, and understanding the nature of the text's origin.
Endpoint
POST https://the-ghost-ai-backend-005c5dcbf4a6.herokuapp.com/detection/ai/
Request Parameters
To utilize the AI Detection feature, send a POST request with the following parameter in the body:
- text (required): The text you want to analyze. This should be a string of the content for which you are seeking an AI, mixed, or human origin prediction.
Headers
Authorization (required): To authenticate your request, include your API key in the request headers using the format "Api-Key your_api_key_here".
Response
The API responds with a JSON object that includes one of the two possibilities:
- 200: The API returns a JSON object containing the probabilities that the text is AI-generated, human-written, or a mix of both, represented as percentages:
- ai: The percentage likelihood that the text was generated by AI.
- mixed: The percentage likelihood that the text contains elements of both AI-generated and human-written content.
- human: The percentage likelihood that the text was written by a human.
- 500: If the request fails, the API returns a JSON object with an error key:
- error: A string detailing the nature of the error encountered during the request.
Example Request
POST https://the-ghost-ai-backend-005c5dcbf4a6.herokuapp.com/detection/ai/ Headers: { "Authorization": "Api-Key your_api_key_here" } Body: {"text": "This text will be analyzed for its origin." }
Example Success Response
{ "ai": .75, "mixed": .15, "human": .1 }
Example Error Response
{ "error": "API key missing or invalid." }
Notes
- The accuracy of the predictions may vary based on the complexity and length of the text. It is recommended to use substantial text samples for more reliable detection results.
- Keep your API key confidential to prevent unauthorized usage.
For further assistance or more detailed inquiries, please consult our support resources or reach out to our customer service team.