Skip to main content
POST
https://text.api.pangram.com
/
v3
AI Detection
curl --request POST \
  --url https://text.api.pangram.com/v3 \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "text": "<string>"
}
'
{
  "text": "<string>",
  "version": "<string>",
  "headline": "<string>",
  "prediction": "<string>",
  "prediction_short": "<string>",
  "fraction_ai": 123,
  "fraction_ai_assisted": 123,
  "fraction_human": 123,
  "num_ai_segments": 123,
  "num_ai_assisted_segments": 123,
  "num_human_segments": 123,
  "dashboard_link": "<string>",
  "windows": [
    {
      "text": "<string>",
      "label": "<string>",
      "ai_assistance_score": 123,
      "confidence": "<string>",
      "start_index": 123,
      "end_index": 123,
      "word_count": 123,
      "token_length": 123
    }
  ]
}
Current
V3 API
Current version
The V3 endpoint replaces all previous detection endpoints with improved AI-assistance detection and segment-level analysis.

POST /v3

Classify text as AI-generated, AI-assisted, or human-written with segment-level analysis.
POST https://text.api.pangram.com/v3

Request

text
string
required
The input text to analyze.
Whether to include a public dashboard link in the response.

Response

text
string
The input text that was analyzed.
version
string
The API version identifier (e.g., "3.0").
headline
string
Classification headline summarizing the result.
prediction
string
Long-form prediction string describing the classification.
prediction_short
string
Short-form prediction string (e.g., "AI", "AI-Assisted", "Human", "Mixed").
fraction_ai
float
Fraction of text classified as AI-written (0.0–1.0).
fraction_ai_assisted
float
Fraction of text classified as AI-assisted (0.0–1.0).
fraction_human
float
Fraction of text classified as human-written (0.0–1.0).
num_ai_segments
integer
Number of text segments classified as AI.
num_ai_assisted_segments
integer
Number of text segments classified as AI-assisted.
num_human_segments
integer
Number of text segments classified as human.
A link to the dashboard page containing the full classification result. Only present when public_dashboard_link is true.
windows
array
List of text segments () analyzed individually.

Example

curl -X POST https://text.api.pangram.com/v3 \
  -H "Content-Type: application/json" \
  -H "x-api-key: your_api_key_here" \
  -d '{
    "text": "The text to analyze with V3 classification"
  }'
Example Response
{
  "text": "The text to analyze with V3 classification",
  "version": "3.0",
  "headline": "AI Detected",
  "prediction": "We are confident that this document is a mix of AI-generated, AI-assisted, and human-written content",
  "prediction_short": "Mixed",
  "fraction_ai": 0.70,
  "fraction_ai_assisted": 0.20,
  "fraction_human": 0.10,
  "num_ai_segments": 7,
  "num_ai_assisted_segments": 2,
  "num_human_segments": 1,
  "windows": [
    {
      "text": "The text to analyze",
      "label": "AI-Generated",
      "ai_assistance_score": 0.85,
      "confidence": "High",
      "start_index": 0,
      "end_index": 19,
      "word_count": 4,
      "token_length": 5
    },
    {
      "text": "with V3 classification",
      "label": "Moderately AI-Assisted",
      "ai_assistance_score": 0.45,
      "confidence": "Medium",
      "start_index": 20,
      "end_index": 49,
      "word_count": 4,
      "token_length": 5
    }
  ]
}