Regions
Draw a box on a page or a photo. Its position is kept relative to the page, rotation included, so it holds on any screen.
PDFPNGJPEGWebP
Define the fields you need and mark a few sample documents. Turn incoming files into structured data, checked against your schema and ready for your team to review.
Explore the sample workflowLive demo opens in a new tab. Examples on this page use fictional documents.
PDF/Photos/CSV/Email/HTML/Text
Fictional documents · sample results
Static previewGive your team time to review the data, instead of retyping it. Doc Lens reads incoming documents, fills the fields you defined and flags answers that do not match your schema.
Define your fields, mark sample documents, choose a model and publish a version. Explore the four steps below; changes stay in this example.
Interactive example · fictional documents. Changes stay in this preview.
These read-only views show the same example schema. Open the live demo to edit fields and upload documents.
Pick a fictional document and run the sample. Explore its extracted fields and JSON, then try the invoice that fails validation and correct its due date. All results here are simulated.
Documents
Fictional files and simulated API calls. No files are uploaded. Timings and token counts are examples.
Simulated API callsBearer doclens_…
Selected fields shown. Line items and supplier tax fields are omitted from this shortened example.
| Invoice number | INV-2057 |
| Issue date | 2026-11-01 |
| Due date | 2026-12-01 |
| Supplier | Acme Supplies Ltd. |
| Currency | EUR |
| Total | 1720.62 |
| PO number | PO-55120 |
Documents 2
Want the real thing? Open the demo backoffice, with three sample businesses and every kind of run.
A person points at the answer once, in the way that fits the document. Doc Lens tells the model where each field was found, so it knows where to look next time.
Regions
Draw a box on a page or a photo. Its position is kept relative to the page, rotation included, so it holds on any screen.
PDFPNGJPEGWebP
Text quotes
Select the passage in exactly the text the model reads. The words around it tell a repeated value apart.
TXTMarkdownHTMLEML
Cell ranges
Drag across a grid named like a spreadsheet. A range of rows becomes the line items, one per row.
CSV
No OCR pipeline to maintain. Files reach the model exactly as uploaded, so a scan or a phone photo is read by a model that sees the page. Every upload is checked against its bytes first, and a format the model can’t read is refused with a reason.
Your data model is a JSON Schema, and every answer is validated against it. An answer that breaks it is marked invalid, with the field and the reason, and kept so you can fix it. Validation checks structure and formats; people can still review and correct values.
Not sure what to extract? Upload a few samples, say what you need, and the model proposes a schema for you to review before saving.
Publishing locks a version, down to the database. Runs finish on the version they started with, and a restored version publishes as the next number.
An invoice and its delivery note, scanned pages, an email and its attachment: read together, in order, into one result.
Fix a result by hand. The run keeps its outcome, and the model’s answer stays beside yours.
Add context to a single run, from the backoffice or the API, without touching the published extractor.
Invoice, receipt and contract data models, so a new extractor never opens on an empty page.
Low, medium or high effort per extractor, or the provider's default, for hard documents or fast ones.
Rate limits, timeouts and provider errors are retried with backoff. Run progress and completed results are recorded for recovery.
Input and output tokens are recorded per run, so you know what each document type costs to read.
Workspaces, invites and magic-link sign-in. Admins set up extractors and keys; members run them and read results.
Phone to wide monitor, light or dark, with a command menu and keyboard shortcuts for people who live in it.
People set extractors up. Programs send documents and read their JSON back. A workspace API key starts runs and reads them, and nothing else, so an integration can never change what an extractor does.
Connect
Address
https://doc-lens.example.comyour server
Authentication
Authorization: Bearer doclens_…
Keys are created in the backoffice, shown once, and can expire.
Send documents to an extractor, poll the run until it is completed or failed, then read its result. Open a call to see it.
3 endpoints
Uploads the documents (multipart) and runs the extractor’s live version on them, or the published version you name, in the background. The version is fixed when the run is accepted, so later changes to the extractor don’t change it. It answers 202 at once with the run, and a Location header saying where to poll it.
Parameters
curl --request POST \
"https://doc-lens.example.com/api/extraction-definitions/supplier-invoices/runs" \
--header "Authorization: Bearer $DOC_LENS_API_KEY" \
--form "documents=@./invoice.pdf" \
--form "documents=@./delivery-note.pdf" \
--form-string "additionalInstructions=Amounts are in EUR."{
"id": "3f0c2a5e-…",
"status": "pending",
"extractionDefinitionSlug": "supplier-invoices",
"version": 3,
"documents": [
{ "name": "invoice.pdf", "contentType": "application/pdf", "position": 1 },
{ "name": "delivery-note.pdf", "contentType": "application/pdf", "position": 2 }
],
"additionalInstructions": "Amounts are in EUR.",
"createdAt": "2026-11-05T09:12:03.000Z",
"startedAt": null,
"completedAt": null,
"error": null,
"errorCode": null,
"resultAvailable": false,
"resultUrl": "/api/extraction-runs/3f0c2a5e-…/result",
"correctedAt": null
}The run, to poll every few seconds until its status is completed or failed. Completed means the model answered with JSON, even if it breaks the data model: the result says whether it is valid. Failed means nothing usable came back, and error and errorCode say why. Read the result once resultAvailable is true.
Parameters
curl "https://doc-lens.example.com/api/extraction-runs/$RUN_ID" \
--header "Authorization: Bearer $DOC_LENS_API_KEY"{
"id": "3f0c2a5e-…",
"status": "completed",
"extractionDefinitionSlug": "supplier-invoices",
"version": 3,
"documents": [
{ "name": "invoice.pdf", "contentType": "application/pdf", "position": 1 },
{ "name": "delivery-note.pdf", "contentType": "application/pdf", "position": 2 }
],
"additionalInstructions": "Amounts are in EUR.",
"createdAt": "2026-11-05T09:12:03.000Z",
"startedAt": "2026-11-05T09:12:04.000Z",
"completedAt": "2026-11-05T09:12:11.000Z",
"error": null,
"errorCode": null,
"resultAvailable": true,
"resultUrl": "/api/extraction-runs/3f0c2a5e-…/result",
"correctedAt": null
}The data, and whether it satisfies the version’s data model: valid, with validationErrors saying where it doesn’t. source is model or human_correction, and revision goes up with each correction, while originalData keeps the model’s answer. Unfinished runs answer 409 result_not_ready; runs that failed without an answer, 404 result_unavailable.
Parameters
curl "https://doc-lens.example.com/api/extraction-runs/$RUN_ID/result" \
--header "Authorization: Bearer $DOC_LENS_API_KEY"{
"extractionRunId": "3f0c2a5e-…",
"valid": true,
"data": {
"invoiceNumber": "INV-2057",
"issueDate": "2026-11-01",
"total": 1720.62,
"purchaseOrderNumber": "PO-55120"
},
"validationErrors": [],
"source": "model",
"revision": 1,
"correctedAt": null,
"correctedBy": null,
"originalData": null
}Errors answer with a status and { "statusCode", "message" }; a message may be a list of problems. Where a program must tell errors apart, a code names it.
Invoices, contracts and patient forms are among the most sensitive files a business keeps. Doc Lens runs on your own infrastructure, and a document goes only to the model provider you configure.
Node.js and PostgreSQL on your servers, documents on local disk or S3-compatible storage such as AWS S3, Cloudflare R2 or MinIO.
Provider keys are encrypted with AES-256-GCM. API keys are shown once, stored only as a hash, can expire and reach runs only.
Every record carries its workspace, and the database itself rejects links across workspaces. Other workspaces' ids answer 404.
Document and sample text is marked as untrusted content. The model is instructed to extract values rather than follow instructions inside a file.
An upload must be what its extension says, down to its bytes. Files open through five-minute signed links in a sandbox.
Database triggers refuse changes to a published version and its samples, so every past run can be explained.
The short version. Anything else, just ask.
Launch is planned for Q1 2027. You can explore the backoffice now in the public demo, with three sample businesses and their documents. Join the early-access list and we will contact you as places open, starting with the document types that fit the first release best.
Yes. Doc Lens runs on your own servers with Node.js and PostgreSQL, and keeps documents on local disk or S3-compatible storage such as AWS S3, Cloudflare R2 or MinIO. The API, the backoffice and the background worker run as one server, with no separate queue to operate.
PDF, PNG, JPEG and WebP, plus plain text, Markdown, HTML, email (.eml) and CSV. Several files can go into one run. Word, Excel, PowerPoint, Outlook .msg and TIFF files are refused with a clear message for now: save them as PDF. Doc Lens never converts or OCRs a file itself; the model reads the original.
The ones you choose, with your own API keys, through Mastra's model router. Models from OpenAI, Anthropic and Google read PDFs and images directly; other providers' models that take attachments read images; every model reads the text formats. Doc Lens checks this when you publish, so an extractor never goes live on a model that can't read its documents. You can also set how much the model reasons.
Not to set it up. People define the fields, mark the samples and publish versions in the backoffice, and can start runs there by hand. Your systems connect through a small REST API: upload documents, poll the run, read the JSON.
Schema validation catches missing fields and invalid types or formats. A value can still match the schema and be factually wrong, so review matters. Runs that break the schema keep their answer with the field and the reason. A person can correct a result, with the model's original answer stored alongside who changed it and when.
No. Published versions never change. Your systems call an extractor by its slug and get the live version, or name a version to pin it. A run always finishes on the version it started with, and any old version can be restored and published again as the next one.
On your infrastructure. Documents, extractors, runs and results stay in your own database and storage. The only thing that leaves is what a run sends to the model provider you configure, using your key.
By default a file can be up to 20 MB and a run can take up to ten files, read together into one result. Both limits are settings on your server. Runs queue in the background, five at a time per workspace.
Yes. The backoffice adapts to any screen, from a phone to a wide monitor, in light or dark mode, so you can check a run or correct a result wherever you are.
Launch is planned for Q1 2027. Join the early-access list, tell us which documents you process and where the data should go, and we will reach out as places open.