API Documentation

Base URL: https://api.optii.eu

Authentication

Include your API key in the X-API-Key or Authorization: Bearer header.

curl https://api.optii.eu/ocr/extract \
  -H "X-API-Key: optii_sk_your_key" \
  -F "file=@document.pdf"

POST /ocr/extract

Extract raw text from an image or PDF.

{
  "success": true,
  "text": "DUMONT & FILS SPRL\nTVA: BE0202239951...",
  "lines": [
    { "text": "DUMONT & FILS SPRL", "confidence": 0.9912, "bbox": [...] }
  ],
  "confidence": 0.9847,
  "processing_time_ms": 342,
  "file_hash": "a3b2c1d4"
}

POST /ocr/invoice

Extract structured invoice fields.

{
  "success": true,
  "supplier_name": "DUMONT & FILS SPRL",
  "supplier_vat": "BE0202239951",
  "invoice_number": "2024-0847",
  "invoice_date": "15/03/2024",
  "total_excl_vat": "1250.00",
  "total_incl_vat": "1512.50",
  "vat_amount": "262.50",
  "currency": "EUR"
}

Supported formats

File types

PNG, JPG, JPEG, TIFF, BMP, WebP, PDF

Languages

French, Dutch, German, English

Error codes

CodeMeaning
400Unsupported file type
401Invalid API key
413File too large
429Rate limit / quota exceeded
500Processing error