> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enkryptai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Detect Hallucination



## OpenAPI

````yaml POST /guardrails/hallucination
openapi: 3.0.0
info:
  title: Enkrypt AI APIs
  version: 2.0.0
servers:
  - url: https://api.enkryptai.com
security:
  - apiKeyAuth: []
tags:
  - name: Guardrails
  - name: Code of Conduct
  - name: Endpoints
  - name: Datasets
  - name: Redteam
  - name: Deployments
  - name: AI Proxy
  - name: Leaderboard
  - name: Archived
  - name: MCP Hub
    description: >-
      MCP Hub vulnerability scanning APIs. Submitting scans (the POST endpoints)
      is open to all authenticated callers. The scan **retrieval** APIs — Get
      Scan Job Status, Get Complete Scan Results, List Scans, and Get MCP Hub
      Scan Statistics (the GET endpoints) — are an **enterprise data-license
      feature**: they require your organization to have MCP Hub API access
      enabled by Enkrypt, otherwise they return `403`. Contact us at
      support@enkryptai.com to enable access.
  - name: MCP Registry Servers
  - name: MCP Gateways
  - name: MCP Playground
paths:
  /guardrails/hallucination:
    post:
      tags:
        - Guardrails
      summary: Detect Hallucination
      operationId: detect_hallucination_detect_hallucination_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GuardrailsHallucinationDetectionRequest'
            examples:
              hallucination_example:
                summary: Example demonstrating hallucination detection
                value:
                  request_text: What is the capital of France?
                  response_text: Tokyo is the capital of France.
                  context: ''
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuardrailsHallucinationDetectionResponse'
              examples:
                hallucination_successful_response:
                  summary: Example of a successful hallucination detection response
                  value:
                    summary:
                      is_hallucination: 1
                    details:
                      prompt_based: 1
components:
  schemas:
    GuardrailsHallucinationDetectionRequest:
      title: GuardrailsHallucinationDetectionRequest
      type: object
      required:
        - request_text
        - response_text
      properties:
        request_text:
          type: string
          title: Request Text
        response_text:
          type: string
          title: Response Text
        context:
          type: string
          title: Context
    GuardrailsHallucinationDetectionResponse:
      title: GuardrailsHallucinationDetectionResponse
      type: object
      required:
        - summary
      properties:
        summary:
          type: object
          title: GuardrailsHallucinationDetectionResponseSummary
          properties:
            is_hallucination:
              title: Is Hallucination
              type: number
              example: 1
              description: Overall hallucination score between 0 and 1
              minimum: 0
              maximum: 1
        details:
          type: object
          title: GuardrailsHallucinationDetectionResponseDetails
          properties:
            prompt_based:
              title: Prompt Based
              type: number
              format: float
              example: 1
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apikey

````