SAGEA LogoDocs & API

OCR Process

Extract text and structure from documents with arva-ocr in markdown, JSON, or text.

POST https://api.sagea.space/v1/ocr/process

Authentication

Send Authorization: Bearer $SAGEA_API_KEY on every request. Get a key

Parameters

Send a multipart/form-data body with the following fields.

ParameterTypeRequiredDescription
modelstringNoOCR model to use. Default is arva-ocr.
documentfileYesPDF, PNG, JPG, TIFF, or WEBP file up to 100MB.
output_formatstringNoOne of markdown, json, or text. Default is markdown.
bboxbooleanNoSet to true to include bounding boxes per block. Default is false.
language_hintstringNoHint such as ne-NP, hi-IN, en-US, or es-ES.
pagesstringNoPage range to process, for example first 5 pages. Default is all pages.

Example request

Extract an NPR 24,500 invoice issued to Aarav Sharma.

curl -X POST https://api.sagea.space/v1/ocr/process \
  -H "Authorization: Bearer $SAGEA_API_KEY" \
  -F "model=arva-ocr" \
  -F "document=@invoice_npr24500.pdf" \
  -F "output_format=json" \
  -F "bbox=true" \
  -F "language_hint=en-US"

Works for Hindi and Nepali documents such as citizenship cards and VAT bills.

Response

A successful call returns text, page count, confidence, and layout blocks.

{
  "text": "INVOICE #INV-2042\nBilled to: Aarav Sharma\nTotal: NPR 24,500\n",
  "pages": 1,
  "confidence": 0.98,
  "model_used": "arva-ocr",
  "blocks": [
    {
      "type": "header",
      "page": 1,
      "bbox": [40, 30, 560, 90],
      "confidence": 0.99,
      "text": "INVOICE #INV-2042"
    },
    {
      "type": "table_row",
      "page": 1,
      "bbox": [40, 220, 560, 260],
      "confidence": 0.97,
      "text": "Total: NPR 24,500"
    }
  ]
}

Set bbox to true when you need word-level coordinates for highlighting.

Errors

StatusCodeFix
400missing_artifactAttach a valid document file to the request.
400unsupported_formatUse PDF, PNG, JPG, TIFF, or WEBP only.
401unauthorizedRe-export a valid SAGEA_API_KEY value.
413payload_too_largeCompress or split file under 100MB.
429rate_limit_exceededBack off and retry with exponential delay.

Limits

ARVA OCR allows 30 requests per minute on Starter and 300 requests per minute on Pro.

What's next

On this page