# Detect AI-sounding prose (/api/admin/deslop)

<!-- agent-signals: reading_time_min: 4 · est_tokens: 2148 · updated: 2026-07-30 -->
Related: [Trigger automation](/api/automations/trigger.md), [Create assistant message](/api/assistant/create-assistant-message-v2.md)

This endpoint analyzes a documentation page for AI-generated prose and returns flagged passages with suggested human rewrites.

Authenticate with an [admin API key](/api/introduction#admin-api-key).

## Credits [#credits]

* Consumes 1 AI credit per checked page.
* The endpoint skips pages under 50 words and does not charge for them. The response returns `skipped: "too_short"` with `creditsCharged: 0`.
* If detection is temporarily unavailable, the endpoint returns `503` and doesn't consume a credit.
* The endpoint accepts up to 30 requests per minute per client IP address.

## Response [#response]

Checked pages return a verdict (`predictionShort`), AI and human fractions, and a `windows` array of flagged passages. Each window includes a line range and can include one to three suggested rewrites.

## Usage [#usage]

```bash
curl -X POST https://api.mintlify.com/v1/deslop/{projectId} \
  -H "Authorization: Bearer mint_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "guides/quickstart.mdx",
    "content": "# Quickstart\n\nWelcome to our comprehensive documentation..."
  }'
```

`POST /v1/deslop/{projectId}`

Analyzes a page for AI-generated prose and returns flagged passages with suggested rewrites. Consumes one AI credit per checked page. Skips pages under 50 words. Limited to 30 requests per minute per client IP address.

## OpenAPI

```json
{
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "name": "projectId",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "Your project ID. Can be copied from the [API keys](https://app.mintlify.com/settings/organization/api-keys) page in your dashboard."
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "path",
            "content"
          ],
          "properties": {
            "path": {
              "type": "string",
              "minLength": 1,
              "description": "Repo-relative path of the page, used for reporting only."
            },
            "content": {
              "type": "string",
              "maxLength": 1000000,
              "description": "The raw MDX or Markdown content of the page to check."
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "The page was checked, or skipped because it was too short.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "path",
              "skipped",
              "creditsCharged"
            ],
            "properties": {
              "path": {
                "type": "string",
                "description": "The path from the request."
              },
              "skipped": {
                "type": "string",
                "nullable": true,
                "enum": [
                  "too_short",
                  null
                ],
                "description": "Reason the page was skipped, or null when the page was checked. `too_short` means the page had fewer than 50 words of prose and was not charged."
              },
              "predictionShort": {
                "type": "string",
                "enum": [
                  "AI",
                  "AI-Assisted",
                  "Human",
                  "Mixed"
                ],
                "description": "Overall verdict for the page. Present only when the page was checked."
              },
              "fractionAi": {
                "type": "number",
                "description": "Fraction of the page detected as AI-generated (0-1)."
              },
              "fractionAiAssisted": {
                "type": "number",
                "description": "Fraction detected as AI-assisted (0-1)."
              },
              "fractionHuman": {
                "type": "number",
                "description": "Fraction detected as human-written (0-1)."
              },
              "windows": {
                "type": "array",
                "description": "Flagged (non-human) passages. Present only when the page was checked.",
                "items": {
                  "type": "object",
                  "required": [
                    "text",
                    "label",
                    "aiAssistanceScore",
                    "startLine",
                    "endLine"
                  ],
                  "properties": {
                    "text": {
                      "type": "string",
                      "description": "The flagged passage text."
                    },
                    "label": {
                      "type": "string",
                      "description": "Detection label for the passage, for example `AI-Generated`."
                    },
                    "aiAssistanceScore": {
                      "type": "number",
                      "description": "AI-assistance score for the passage (0-1)."
                    },
                    "confidence": {
                      "description": "Detection confidence, returned as either a label such as `High` or a numeric score.",
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "startLine": {
                      "type": "integer",
                      "description": "1-based start line of the passage in the original content."
                    },
                    "endLine": {
                      "type": "integer",
                      "description": "1-based end line of the passage in the original content."
                    },
                    "rewrites": {
                      "type": "array",
                      "description": "Suggested human rewrites of the passage.",
                      "items": {
                        "type": "object",
                        "required": [
                          "text",
                          "rationale"
                        ],
                        "properties": {
                          "text": {
                            "type": "string",
                            "description": "The rewritten passage."
                          },
                          "rationale": {
                            "type": "string",
                            "description": "Why the rewrite reads more human."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "creditsCharged": {
                "type": "integer",
                "description": "AI credits charged for this request (0 when skipped)."
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "Invalid request body.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Error message."
              }
            }
          }
        }
      }
    },
    "402": {
      "description": "Insufficient AI credits.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Error message."
              }
            }
          }
        }
      }
    },
    "429": {
      "description": "Rate limit exceeded.",
      "content": {
        "text/plain": {
          "schema": {
            "type": "string",
            "example": "Too many requests, please try again later."
          }
        }
      }
    },
    "500": {
      "description": "An unexpected error occurred while processing the page."
    },
    "503": {
      "description": "Detection is temporarily unavailable. No credit is charged.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Error message."
              }
            }
          }
        }
      }
    }
  }
}
```
