ocr

Ocr

OCR endpoint for extracting text from documents and images.

Supports two input modes:

1. JSON body (Mistral OCR API compatible):

curl -X POST "http://localhost:4000/v1/ocr"         -H "Authorization: Bearer sk-1234"         -H "Content-Type: application/json"         -d '{
        "model": "mistral-ocr",
        "document": {
            "type": "document_url",
            "document_url": "https://arxiv.org/pdf/2201.04234"
        }
    }'

2. Multipart form file upload:

curl -X POST "http://localhost:4000/v1/ocr"         -H "Authorization: Bearer sk-1234"         -F "model=mistral-ocr"         -F "file=@document.pdf"

Response format is normalized to the LiteLLM OCR schema by default. Providers that support it (Azure Document Intelligence) can return their own payload instead, with cost tracking unchanged, via x-req-format: native (or "req_format": "native" in the body).

post/ocr

Response

Successful Response

{"stackTrail":"paths:/ocr:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}

Changes