
Document OCR that reads PDFs and images into structured Markdown, page by page, with tables, math, charts, image regions, and layout.
Document OCR that reads PDFs and images into structured Markdown, page by page, with tables, math, charts, image regions, and layout.
Also known as LightOnOCR-3-4B
lightonocr-3-4b/v1/ocrlightonai/lightonocr-3-4bLive pay-as-you-go rates from the EmpirioLabs catalog. You are billed only for what you use, with no monthly minimum.
LightOnOCR-3 4B reads PDFs and images through POST /v1/ocr and returns each page as Markdown. Send the PDF's URL in document with the model id lightonocr-3-4b, and list zero-based page numbers in pages to process only those pages. An image works the same way with {"type": "image_url", "image_url": "https://..."}, and either URL can be a base64 data URI. The response lists each page in pages with its index, markdown, images, tables, and dimensions; usage_info.pages_processed counts the pages processed. A request still running after a few minutes returns a job_id to poll at GET /v1/jobs/{job_id}, and a Prefer: respond-async header asks for the job id at once. Get an API key from the EmpirioLabs dashboard.
curl https://api.empiriolabs.ai/v1/ocr \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "lightonocr-3-4b",
"document": {
"type": "document_url",
"document_url": "https://arxiv.org/pdf/2412.13663"
},
"pages": [0, 1],
"include_image_base64": false
}'import requests
response = requests.post(
"https://api.empiriolabs.ai/v1/ocr",
headers={"Authorization": "Bearer YOUR_EMPIRIOLABS_API_KEY"},
json={
"model": "lightonocr-3-4b",
"document": {
"type": "document_url",
"document_url": "https://arxiv.org/pdf/2412.13663",
},
"pages": [0, 1],
"include_image_base64": False,
},
)
result = response.json()
for page in result["pages"]: # index, markdown, images, tables, dimensions
print(page["index"], page["markdown"][:200])
print(result["usage_info"]["pages_processed"])Request parameters supported by the LightOnOCR-3 4B API on EmpirioLabs. Defaults apply when a field is omitted.
| Parameter | Type | Default | Range / values | Description |
|---|---|---|---|---|
| document | object | - | - | The PDF (document_url) or image (image_url) to read, as a public URL or a base64 data URI, up to 50 MB. |
| pages | string | - | - | Zero-based pages to read, as a list such as [0, 2] or a string such as 0,2-4. Every page when empty, up to 1,000. |
| include_image_base64 | boolean | false | - | Return each image region on the page as a JPEG data URI. |
| table_format | enum | - | markdown, html | Return each table separately in this format. Tables stay in the page Markdown as HTML when unset. |
| extract_header | boolean | false | - | Move the page header out of the Markdown into its own field. |
| extract_footer | boolean | false | - | Move the page footer out of the Markdown into its own field. |
| image_limit | integer | - | min 0 | Return at most this many images for the whole document, the first ones first. |
| image_min_size | integer | - | min 0 | Leave out image regions narrower or shorter than this many pixels. |
| include_blocks | boolean | true | - | Include every region of each page in reading order, with its type, position and content. |
Reads PDFs and images into Markdown, page by page: text in reading order, headings, lists, tables, math, captions, and charts with their data points as a table.
On EmpirioLabs, LightOnOCR-3 4B is billed pay as you go: Document OCR $3.00 per 1,000 pages, minimum 5 pages per request. The live rate card on this page always matches what the API charges.
LightOnOCR-3 4B is served through POST /v1/ocr on api.empiriolabs.ai with standard bearer-token authentication.
Yes. The EmpirioLabs playground runs LightOnOCR-3 4B in the browser with the same parameters the API exposes, so you can test prompts before writing code.
Create an EmpirioLabs account, then generate a key under API Keys in the dashboard. Billing is pay-as-you-go credits, so you only pay for the requests you make.
Check out our pricing or reach out if you want your own model deployed on our stack.