Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developers.lighton.ai/llms.txt

Use this file to discover all available pages before exploring further.

Parse converts a document to structured Markdown without storing or indexing it. The call is synchronous — send a file, get Markdown back immediately. Use Parse when you want the text content of a document for your own purposes: feeding it to an LLM, storing it in your database, displaying it in a UI, or pre-processing it before ingestion. Nothing is saved on LightOn’s side.
If you want the document to be searchable, use Files instead — it ingests and indexes the document permanently. The full schema for POST /api/v3/parse is in the API reference.

Parse a document

import requests

response = requests.post(
    "https://api.lighton.ai/api/v3/parse",
    headers={"Authorization": "Bearer $CONSOLE_API_KEY"},
    files={"file": open("report.pdf", "rb")},
)

markdown = response.json()["result"]["content"]
print(markdown[:200])
# → # Q4 Financial Report\n\n## Executive Summary\n\nRevenue grew 18%…
file (multipart) and document (JSON URL) are mutually exclusive — pass one or the other.

What comes back

The response includes the Markdown content along with metadata about the original document:
{
  "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": "report.pdf",
    "page_count": 3,
    "file_size_bytes": 245120,
    "mime_type": "application/pdf"
  },
  "result": {
    "content": "# Invoice\n\nInvoice Number: INV-2026-001\nDate: March 15, 2026\n…"
  },
  "usage": {
    "pages_processed": 3
  }
}
The result.content field is the full document as Markdown. Headings, lists, tables, and code blocks are preserved where the source document supports them.

Supported formats and limits

Formats: .pdf, .png, .jpg, .jpeg, .pptx, .ppt, .odp, .docx, .odt, .doc, .html Sync limits: 20 MB per file · 15 pages per request For longer documents, split into chunks before calling Parse, or ingest the full document with Files and use Search to retrieve relevant sections.

Common errors

StatusCause
400Missing document, unsupported format, or page limit exceeded
401Missing or invalid API key
413File exceeds the 20 MB size limit
429Rate limit exceeded
503Parsing backend is overloaded — retry later