Share via

Azure Mistral OCR API does not support confidence_scores_granularity parameter

Vu Thi Mai Linh(TMI) 0 Reputation points
2026-05-14T06:21:40.6533333+00:00

I am currently integrating the Azure-hosted Mistral OCR API

I would like to retrieve OCR confidence scores (especially word-level confidence), similar to the native Mistral OCR API functionality.

However, when sending the following parameter:

{
  "confidence_scores_granularity": "word"
}

the API returns HTTP 422 with this error:

{
  "error": {
    "code": "Invalid input",
    "message": "{\"detail\":[{\"type\":\"extra_forbidden\",\"loc\":[\"body\",\"confidence_scores_granularity\"],\"msg\":\"Extra inputs are not permitted\",\"input\":\"word\"}]}",
    "status": 422
  }
}

Environment details:

  • Region: Japan East
  • Endpoint type: Azure-hosted Mistral OCR

Questions:

  1. Does Azure Mistral OCR currently support OCR confidence scores?
  2. Is there another Azure-compatible parameter or API version for retrieving word/page confidence values in Mistral?

Our use case requires OCR confidence values to validate scanned PDF quality and detect low-confidence OCR regions.

Thank you for your support.

Microsoft Foundry
Microsoft Foundry

A unified Azure platform for creating and managing AI models, agents, and applications with built‑in enterprise security, monitoring, and governance


1 answer

Sort by: Most helpful
  1. Manas Mohanty 16,755 Reputation points Microsoft External Staff Moderator
    2026-05-18T18:36:19.0466667+00:00

    Vu Thi Mai Linh(TMI)

    Azure-hosted Mistral OCR currently does not support the confidence_scores_granularity parameter.

    The HTTP 422 (extra_forbidden) error confirms the parameter is not part of the Azure-exposed API schema.

    There is no alternative Azure parameter today to retrieve word/page confidence scores from Mistral OCR.

    🔍 What’s might be happening

    1. Native Mistral vs Azure-hosted Mistral (key difference)

    The native Mistral OCR API supports:

    JSON"confidence_scores_granularity": "word" | "page"Show more lines

    → returns confidence scores per word/page [docs.mistral.ai]

    However, in Azure AI Foundry (Azure-hosted Mistral):

    The request schema is restricted

    Unsupported fields are rejected with:

    extra_forbidden → Extra inputs are not permitted

    Azure exposes a subset of the upstream Mistral API, and confidence_scores_granularity is currently not included.

    Does Azure Mistral OCR return confidence scores?

    Based on available documentation and behavior:

    Azure Mistral OCR:

    ✅ Returns extracted content (markdown/text/structured output)

    ❌ Does NOT return confidence scores (word/page)

    There is no documented field in Azure Mistral responses for confidence values.

    ⚠️ Important implication for your use case

    “validate scanned PDF quality and detect low-confidence regions”

    This cannot currently be implemented using Azure Mistral OCR alone.

    ✅ Recommended alternatives (Azure-supported)

    Since you’re doing quality validation / low-confidence detection, here are practical workarounds used in real customer scenarios:

    Option 1 — Use Azure Document Intelligence

    Azure Document Intelligence provides:

    ✅ Word-level confidence scores

    ✅ Page-level / field-level confidence

    ✅ Production-grade OCR + structured extraction

    Microsoft explicitly documents:

    “Document Intelligence returns confidence for predicted words… between 0 and 1” [learn.microsoft.com]

    👉 Best fit for:

    OCR quality validation

    Threshold-based filtering (e.g., reject < 0.8 confidence)

    Compliance / human-in-the-loop workflows

    Option 2 — Dual-pass pipeline (common workaround)

    If you must use Mistral OCR for layout/quality:

    Pattern

    Run Mistral OCR

    Get high-quality markdown + structure

    Run Document Intelligence (Read OCR)

    Extract confidence scores

    Align results

    Map words/regions between outputs

    Use Document Intelligence confidence as proxy

    Option 3 — Native Mistral (non-Azure endpoint)

    Native Mistral API supports the parameter, You can call them via Custom functions

    Hope it helps.

    Thank you.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.