Skip to main content

Endpoint

POST /v3/universal-ai/async (async) Model string pattern: ocr/ocr_async/{provider}[/{model}]

Input

FieldTypeRequiredDescription
filefile_inputYesPDF or image file ID from /v3/upload or direct file URL

Output

FieldTypeRequiredDescription
raw_textstringYes
pagesarray[object]NoList of pages
    linesarray[object]NoList of lines
        textstringYesText detected in the line
        wordsarray[object]NoList of words
            textstringYesText detected in the word
            bounding_boxobjectYesBounding boxes of the words in the word
                leftfloatYesLeft coordinate of the bounding box
                topfloatYesTop coordinate of the bounding box
                widthfloatYesWidth of the bounding box
                heightfloatYesHeight of the bounding box
            confidencefloatYesConfidence score of the word
        bounding_boxobjectNoBounding box of the line, can be None
            leftfloatYesLeft coordinate of the bounding box
            topfloatYesTop coordinate of the bounding box
            widthfloatYesWidth of the bounding box
            heightfloatYesHeight of the bounding box
        confidencefloatYesConfidence of the line
number_of_pagesintYesNumber of pages in the document

Available Providers

ProviderModel StringPrice
amazonocr/ocr_async/amazon$1.5 per 1,000 pages
microsoftocr/ocr_async/microsoft$10 per 1,000 pages
mistralocr/ocr_async/mistral$1 per 1,000 pages

Quick Start

This is an async feature. The initial response returns a job ID. Poll GET /v3/universal-ai/async/{job_id} until the job completes.
import requests

url = "https://api.edenai.run/v3/universal-ai/async"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

payload = {
    "model": "ocr/ocr_async/amazon",
    "input": {
        "file": "YOUR_FILE_UUID_OR_URL"
    }
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())