Microsoft Azure Text:detect Groundedness API

The text:detectGroundedness API from Microsoft Azure, for text:detectgroundedness.

GitHub OpenAPI
Business capability
Artificial Intelligence Management BC-610.60

Operations 1

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /text:detectGroundedness Detect ungrounded content in an LLM response · Microsoft Azure Detect Groundedness #
Ask an LLM
“How do I check whether a language model's answer is supported by my source documents?”
“Can I get reasoning for why content was flagged as ungrounded?”
Tell an agent
Check whether {text} is grounded in sources {sources}.
Detect hallucinations in {text} against {sources} for task {task}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/microsoft-azure:microsoft-azure-text-detectgroundedness-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

microsoft-azure-text-detectgroundedness-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Microsoft Azure ContentSafety Service Text:detect…
  version: 2024-02-15-preview
  description: Analyze harmful content
  x-typespec-generated:
  - emitter: '@azure-tools/typespec-autorest'
security:
- ApiKeyAuth: []
- OAuth2Auth:
  - https://cognitiveservices.azure.com/.default
tags:
- name: text:detectGroundedness
paths:
  /text:detectGroundedness:
    post:
      operationId: microsoftAzureTextgroundednessdetectionoperationsDetectgroundednessoptions
      summary: Microsoft Azure Detect Groundedness
      description: A synchronous API for the analysis of language model outputs to determine alignment with user-provided information or identify fictional content.
      parameters:
      - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyzeTextGroundednessResult'
        default:
          description: An unexpected error response.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
      x-ms-examples:
        Detect Groundedness:
          $ref: ./examples/DetectGroundedness.json
      tags:
      - text:detectGroundedness
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnalyzeTextGroundednessOptions'
        description: The text groundedness detection request.
        required: true
components:
  schemas:
    LLMResource:
      type: object
      description: Connection details for the LLM resource.
      properties:
        resourceType:
          type: string
          description: LLM resource type. The default value is AzureOpenAI.
          default: AzureOpenAI
          enum:
          - AzureOpenAI
          x-ms-enum:
            name: LLMResourceType
            modelAsString: true
            values:
            - name: AzureOpenAI
              value: AzureOpenAI
              description: Azure OpenAI resource type.
        azureOpenAIEndpoint:
          type: string
          description: Endpoint for Azure OpenAI resource.
        azureOpenAIDeploymentName:
          type: string
          description: Deployment model name.
      required:
      - azureOpenAIEndpoint
      - azureOpenAIDeploymentName
    QnAOptions:
      type: object
      description: The request of QnA options.
      properties:
        query:
          type: string
          description: The user's question input in a QnA scenario.
          maxLength: 7500
      required:
      - query
    Azure.Core.Foundations.Error:
      type: object
      description: The error object.
      properties:
        code:
          type: string
          description: One of a server-defined set of error codes.
        message:
          type: string
          description: A human-readable representation of the error.
        target:
          type: string
          description: The target of the error.
        details:
          type: array
          description: An array of details about specific errors that led to this reported error.
          items:
            $ref: '#/components/schemas/Azure.Core.Foundations.Error'
          x-ms-identifiers: []
        innererror:
          $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
          description: An object containing more specific information than the current object about the error.
      required:
      - code
      - message
    Azure.Core.Foundations.InnerError:
      type: object
      description: An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
      properties:
        code:
          type: string
          description: One of a server-defined set of error codes.
        innererror:
          $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
          description: Inner error.
    AnalyzeTextGroundednessResult:
      type: object
      description: The response of groundedness detection.
      properties:
        ungroundedDetected:
          type: boolean
          description: Indicates whether the text exhibits ungroundedness.
        ungroundedPercentage:
          type: number
          format: float
          description: "Specifies the proportion of the text identified as ungrounded, \nexpressed as a decimal between 0 and 1,\nwhere 0 indicates no grounded content and 1 indicates entirely grounded content.."
        ungroundedDetails:
          type: array
          description: Provides insights into ungrounded content with specific examples and percentages.
          items:
            $ref: '#/components/schemas/UngroundednessDetails'
          x-ms-identifiers: []
      required:
      - ungroundedDetected
      - ungroundedPercentage
      - ungroundedDetails
    UngroundednessDetails:
      type: object
      description: The detailed information about a text identified as ungroundedness.
      properties:
        text:
          type: string
          description: The grounded text.
        offset:
          $ref: '#/components/schemas/IndexDetails'
          description: The offset when grounded text starts.
        length:
          $ref: '#/components/schemas/IndexDetails'
          description: The length of the grounded text.
        reason:
          type: string
          description: 'The explanation for detected ungroundedness, enhancing understanding.

            Only when the ''reasoning'' field in the input is set to true ''reason'' field will be returned.'
      required:
      - text
      - offset
      - length
    Azure.Core.Foundations.ErrorResponse:
      type: object
      description: A response containing error details.
      properties:
        error:
          $ref: '#/components/schemas/Azure.Core.Foundations.Error'
          description: The error object.
      required:
      - error
    AnalyzeTextGroundednessOptions:
      type: object
      description: The request of groundedness detection.
      properties:
        domain:
          type: string
          description: 'The domain of the text for analysis. Allowed values: Medical, Generic.

            This field is optional, with a default value of Generic.'
          default: Generic
          enum:
          - Generic
          - Medical
          x-ms-enum:
            name: GroundednessDomain
            modelAsString: true
            values:
            - name: Generic
              value: Generic
            - name: Medical
              value: Medical
        task:
          type: string
          description: 'The task type for the text analysis. Type of task: QnA, Summarization.

            This field is optional, with a default value of Summarization.'
          default: Summarization
          enum:
          - Summarization
          - QnA
          x-ms-enum:
            name: GroundednessTask
            modelAsString: true
            values:
            - name: Summarization
              value: Summarization
            - name: QnA
              value: QnA
        qna:
          $ref: '#/components/schemas/QnAOptions'
          description: 'The user''s question input in a QnA scenario.

            This field is optional, but if the task type is set to QnA, it becomes required.'
        text:
          type: string
          description: The specific text that needs to be checked.
          maxLength: 7500
        groundingSources:
          type: array
          description: 'Leverages a vast array of grounding sources to validate AI-generated text.

            Limit: Restrictions on the total amount of grounding sources that can be analyzed in a single request are 55K characters.'
          items:
            type: string
        reasoning:
          type: boolean
          description: 'A value indicating if the output includes an explanation for the identified groundedness.

            This field is optional, with a default value of false.'
        llmResource:
          $ref: '#/components/schemas/LLMResource'
          description: "Connection details for the LLM resource. \nThis field will be used only when the 'reasoning' field is set to true; otherwise, it will be ignored."
      required:
      - text
      - groundingSources
    IndexDetails:
      type: object
      description: The index details.
      properties:
        utf8:
          type: integer
          format: int64
          description: Indicate the index when encoding is UTF-8.
        utf16:
          type: integer
          format: int64
          description: Indicate the index when encoding is UTF-16.
        codePoint:
          type: integer
          format: int64
          description: Indicate the index with code point format.
      required:
      - utf8
      - utf16
      - codePoint
  parameters:
    Azure.Core.Foundations.ApiVersionParameter:
      name: api-version
      in: query
      description: The API version to use for this operation.
      required: true
      x-ms-parameter-location: method
      x-ms-client-name: apiVersion
      schema:
        type: string
        minLength: 1
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Ocp-Apim-Subscription-Key
      in: header
    OAuth2Auth:
      type: oauth2
      flows:
        clientCredentials:
          scopes:
            https://cognitiveservices.azure.com/.default: ''
          tokenUrl: https://login.microsoftonline.com/common/oauth2/v2.0/token
x-ms-parameterized-host:
  hostTemplate: '{endpoint}/contentsafety'
  useSchemePrefix: false
  parameters:
  - name: endpoint
    in: path
    description: 'Supported Cognitive Services endpoints (protocol and hostname, for example:

      https://<resource-name>.cognitiveservices.azure.com).'
    required: true
    type: string