For the complete documentation index, see llms.txt. This page is also available as Markdown.

OCR [BETA]

Process a document with OCR

post

This endpoint extracts text and structured content from a document or image using the specified OCR model.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body

A request object for processing a document or image and controlling router behavior.

preferencestring · enumOptional

The provider preference for handling the request.

Possible values:
allowed_providersstring[] · nullableOptional

The providers that are allowed to process the request.

eu_nativeboolean · nullableOptional

Whether to use only providers based and regulated within the EU.

allow_quantizationboolean · nullableOptional

Whether to allow quantized endpoints.

allow_zero_data_retentionboolean · nullableOptional

Whether to use only zero-data-retention providers.

enable_model_fallbackboolean · nullableOptional

Whether to allow model fallback when the requested model is unavailable.

fallbacksstring[] · nullableOptional

Fallback model names to try when the requested model is unavailable.

modelstringRequired
documentone ofRequired
or
pagesone ofOptional
integer[]Optional
or
stringOptional
include_image_base64booleanOptional
image_limitinteger · nullableOptional
image_min_sizeinteger · nullableOptional
include_blocksbooleanOptionalDefault: true
document_annotation_formatobjectOptional
bbox_annotation_formatobjectOptional
document_annotation_promptstringOptional
extract_headerbooleanOptional
extract_footerbooleanOptional
table_formatstring · enumOptionalPossible values:
confidence_scores_granularitystring · enumOptionalPossible values:
Responses
200

OCR result

application/json
objectstring · enumRequiredPossible values:
modelstringRequired
document_annotationone of · nullableOptional
objectOptional
or
stringOptional
post/ocr
curl https://api.cortecs.ai/v1/ocr \
  -H "Authorization: Bearer $CORTECS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"mistral-ocr-4.1","document":{"type":"document_url","document_url":"https://example.com/document.pdf"}}'
{
  "object": "ocr",
  "model": "text",
  "pages": [
    {
      "index": 1,
      "markdown": "text",
      "images": [
        {}
      ]
    }
  ],
  "document_annotation": {},
  "usage_info": {
    "pages_processed": 1,
    "credits": 1
  }
}

Last updated