> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-mintlify-3e3f4eba.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Detect AI-sounding prose

> 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.

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

* 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

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

```bash theme={null}
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..."
  }'
```


## OpenAPI

````yaml admin-openapi.json POST /v1/deslop/{projectId}
openapi: 3.0.1
info:
  title: Mintlify Admin API
  description: >-
    An API for administrative operations including documentation updates and
    agent management.
  version: 2.0.0
servers:
  - url: https://api.mintlify.com
security:
  - bearerAuth: []
paths:
  /v1/deslop/{projectId}:
    post:
      summary: Detect AI-sounding prose in a page
      description: >-
        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.
      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:
                $ref: '#/components/schemas/DeslopResult'
        '400':
          description: Invalid request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Insufficient AI credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '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:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    DeslopResult:
      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:
            $ref: '#/components/schemas/DeslopWindow'
        creditsCharged:
          type: integer
          description: AI credits charged for this request (0 when skipped).
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message.
    DeslopWindow:
      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.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The Authorization header expects a Bearer token. Use an admin API key.
        This is a server-side secret key. Generate one on the [API keys
        page](https://app.mintlify.com/settings/organization/api-keys) in your
        dashboard.

````