Additional capabilities
Detect AI content
The AI Detection API detects AI-generated content in text. It provides a score between 0 and 1 that indicates the confidence that the content is AI- or human-generated.
You need an API key to access the Writer API. Get an API key by following the steps in the API quickstart.
We recommend setting the API key as an environment variable in a .env
file with the name WRITER_API_KEY
.
AI Detection endpoint
Endpoint: POST /v1/ai-detect
Request body
The request body is a JSON object with the following fields. All fields are required.
Parameter | Type | Description |
---|---|---|
input | string | The text to detect AI content in. |
Response format
The response is a JSON object with the following fields.
Parameter | Type | Description |
---|---|---|
label | string | The label of the AI content. fake indicates the text is AI-generated, real indicates the text is human-generated. |
score | number | The confidence score of the label, from 0 to 1. |