curl --request POST \
--url https://paradigm.lighton.ai/api/v3/parse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document": "https://example.com/invoice.pdf"
}
'{
"id": "parse_0196e4b2a3c14d5e8f7a9b2c1d0e3f4a",
"status": "completed",
"created_at": "2026-03-31T10:00:00+00:00",
"completed_at": "2026-03-31T10:00:03+00:00",
"processing_time_ms": 2840,
"document": {
"filename": "invoice.pdf",
"page_count": 3,
"file_size_bytes": 245120,
"mime_type": "application/pdf"
},
"result": {
"pages": [
{
"index": 1,
"markdown": "# Invoice\n\nInvoice Number: INV-2026-001\nDate: March 15, 2026"
},
{
"index": 2,
"markdown": "## Terms\n\nPayment is due within 30 days..."
},
{
"index": 3,
"markdown": "## Appendix\n\nLine items continued..."
}
]
},
"usage": {
"pages_processed": 3
}
}{
"id": "parse_Kg",
"status": "pending",
"created_at": "2026-03-31T10:00:00+00:00"
}{
"id": null,
"code": 400,
"error": "max_pages_exceeded",
"detail": "Document has 1200 pages, exceeding the async limit of 1000 pages.",
"doc_url": "https://developers.lighton.ai/errors#max_pages_exceeded"
}{
"id": null,
"code": 401,
"error": "unauthorized",
"detail": "Authentication credentials were not provided or are invalid.",
"doc_url": "https://developers.lighton.ai/errors#unauthorized"
}{
"id": null,
"code": 413,
"error": "payload_too_large",
"detail": "File size (157286400 bytes) exceeds the 100MB async limit.",
"doc_url": "https://developers.lighton.ai/errors/payload_too_large"
}{
"id": null,
"code": 422,
"error": "validation_error",
"detail": "One or more fields failed validation.",
"doc_url": "https://developers.lighton.ai/errors#validation_error",
"fields": {
"document": [
{
"error": "required",
"detail": "A file upload or document URL is required."
}
]
}
}{
"id": null,
"code": 429,
"error": "too_many_requests",
"detail": "Too many requests. Please try again later.",
"doc_url": "https://developers.lighton.ai/errors#too_many_requests"
}{
"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
Convert a document into readable, structured Markdown content.
Accepts either a file upload (multipart/form-data) or a document URL (JSON body).
Sync mode (default)
Blocks until parsing completes and returns 200 with the full markdown result.
curl -X POST https://api.lighton.ai/api/v3/parse \
-H 'Authorization: Bearer $TOKEN' \
-F file=@invoice.pdf
Async mode (options.async = true)
Returns 202 immediately with a parse_<token> job id. Poll GET /api/v3/parse/{id} with that same id until status is completed or failed.
curl -X POST https://api.lighton.ai/api/v3/parse \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{"document": "https://example.com/report.pdf", "options": {"async": true}}'
For multipart uploads, pass options as a JSON-encoded form field: -F 'options={"async":true}'.
Supported file types: .pdf, .png, .jpg, .jpeg, .pptx, .ppt, .odp, .docx, .odt, .doc, .html
Sync limits: 20 MB file size, 15 pages.
Async limits: 100 MB file size, 1000 pages.
curl --request POST \
--url https://paradigm.lighton.ai/api/v3/parse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document": "https://example.com/invoice.pdf"
}
'{
"id": "parse_0196e4b2a3c14d5e8f7a9b2c1d0e3f4a",
"status": "completed",
"created_at": "2026-03-31T10:00:00+00:00",
"completed_at": "2026-03-31T10:00:03+00:00",
"processing_time_ms": 2840,
"document": {
"filename": "invoice.pdf",
"page_count": 3,
"file_size_bytes": 245120,
"mime_type": "application/pdf"
},
"result": {
"pages": [
{
"index": 1,
"markdown": "# Invoice\n\nInvoice Number: INV-2026-001\nDate: March 15, 2026"
},
{
"index": 2,
"markdown": "## Terms\n\nPayment is due within 30 days..."
},
{
"index": 3,
"markdown": "## Appendix\n\nLine items continued..."
}
]
},
"usage": {
"pages_processed": 3
}
}{
"id": "parse_Kg",
"status": "pending",
"created_at": "2026-03-31T10:00:00+00:00"
}{
"id": null,
"code": 400,
"error": "max_pages_exceeded",
"detail": "Document has 1200 pages, exceeding the async limit of 1000 pages.",
"doc_url": "https://developers.lighton.ai/errors#max_pages_exceeded"
}{
"id": null,
"code": 401,
"error": "unauthorized",
"detail": "Authentication credentials were not provided or are invalid.",
"doc_url": "https://developers.lighton.ai/errors#unauthorized"
}{
"id": null,
"code": 413,
"error": "payload_too_large",
"detail": "File size (157286400 bytes) exceeds the 100MB async limit.",
"doc_url": "https://developers.lighton.ai/errors/payload_too_large"
}{
"id": null,
"code": 422,
"error": "validation_error",
"detail": "One or more fields failed validation.",
"doc_url": "https://developers.lighton.ai/errors#validation_error",
"fields": {
"document": [
{
"error": "required",
"detail": "A file upload or document URL is required."
}
]
}
}{
"id": null,
"code": 429,
"error": "too_many_requests",
"detail": "Too many requests. Please try again later.",
"doc_url": "https://developers.lighton.ai/errors#too_many_requests"
}{
"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
Response
Sync parse — document parsed successfully.
Synchronous POST /api/v3/parse response — the parse completed inline.