curl --request POST \
--url https://paradigm.lighton.ai/api/v3/ocr \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'file=<string>'import requests
url = "https://paradigm.lighton.ai/api/v3/ocr"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://paradigm.lighton.ai/api/v3/ocr', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"model": "LightOnOCR",
"total_pages": 3,
"pages_parsed": [
1,
2,
3
],
"processing_time_ms": 4520,
"enable_antilooping": true,
"sampling_params": {
"temperature": 0.2,
"max_tokens": 5888,
"repetition_penalty": null
},
"pages": [
{
"index": 1,
"markdown": "# Invoice\n\n| Item | Qty | Price |\n|---|---|---|\n| Widget A | 10 | $5.00 |"
},
{
"index": 2,
"markdown": "## Terms and Conditions\n\nPayment is due within 30 days..."
},
{
"index": 3,
"markdown": "## Appendix\n\n![Figure 1: Sales chart summary]"
}
]
}{
"id": null,
"code": 422,
"error": "validation_error",
"detail": "One or more fields failed validation.",
"doc_url": "https://developers.lighton.ai/errors#validation_error",
"fields": {
"<field_name>": [
{
"error": "required",
"detail": "This field is required."
}
]
}
}{
"detail": "System is under maintenance.",
"error": "service_maintenance",
"mode": "full_shutdown",
"reason": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"endpoint_category_names": [
"<string>"
]
}Parse a document to Markdown via VLM
Deprecated: Use the v3 parse endpoint instead.
Upload a file for synchronous OCR processing. This endpoint is intended for lightweight, low-volume document parsing and returns results inline in the response.
For large documents, high-throughput workloads, or asynchronous processing, use the /files endpoints, which are optimized for those use cases.
Supported file types: .pdf, .png, .jpg, .jpeg, .pptx, .ppt, .odp, .docx, .odt, .doc, .html
A maximum of 16 pages are processed per request. For documents exceeding this limit, split the content across multiple sequential calls using the pages parameter (e.g., pages="1-16" for the first call, pages="17-32" for the second).
Concurrency limit: Only one OCR request per user can run at a time. A second concurrent request will be rejected with a 429 status.
curl --request POST \
--url https://paradigm.lighton.ai/api/v3/ocr \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'file=<string>'import requests
url = "https://paradigm.lighton.ai/api/v3/ocr"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://paradigm.lighton.ai/api/v3/ocr', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"model": "LightOnOCR",
"total_pages": 3,
"pages_parsed": [
1,
2,
3
],
"processing_time_ms": 4520,
"enable_antilooping": true,
"sampling_params": {
"temperature": 0.2,
"max_tokens": 5888,
"repetition_penalty": null
},
"pages": [
{
"index": 1,
"markdown": "# Invoice\n\n| Item | Qty | Price |\n|---|---|---|\n| Widget A | 10 | $5.00 |"
},
{
"index": 2,
"markdown": "## Terms and Conditions\n\nPayment is due within 30 days..."
},
{
"index": 3,
"markdown": "## Appendix\n\n![Figure 1: Sales chart summary]"
}
]
}{
"id": null,
"code": 422,
"error": "validation_error",
"detail": "One or more fields failed validation.",
"doc_url": "https://developers.lighton.ai/errors#validation_error",
"fields": {
"<field_name>": [
{
"error": "required",
"detail": "This field is required."
}
]
}
}{
"detail": "System is under maintenance.",
"error": "service_maintenance",
"mode": "full_shutdown",
"reason": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"endpoint_category_names": [
"<string>"
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The document to parse.
technical_name of an enabled parser model. Falls back to platform default.
Page range to parse. Accepted formats: "all" (default), a single page "3", a range "1-5", comma-separated pages "1,3,7", or mixed "2-4,8". Duplicates are ignored. Maximum 16 pages per request — using "all" on a document exceeding this limit returns 400. For larger documents, paginate with sequential range calls.
Detect repetitive generation loops and retry the page with progressively higher temperatures (above temperature) until the output is non-looping. Disable to get a single VLM call at the exact temperature requested.
Sampling temperature for the VLM. Lower values (e.g. 0.1) produce more deterministic results; higher values (e.g. 1.0) increase variety. Range: 0.0–2.0.
0 <= x <= 2Maximum number of tokens the model can generate per page. Higher values allow longer outputs but increase processing time. Range: 1–16384.
1 <= x <= 16384Penalizes repeated tokens to reduce redundant output. A value of 1.0 applies no penalty; higher values (e.g. 1.2) discourage repetition more strongly. Range: 1.0–2.0.
1 <= x <= 2