Skip to main content
Autype Lens is a suite of AI-powered endpoints for document understanding. Under the hood, Lens combines modified open-source models to provide both stability and comprehensive functionality for processing PDFs, DOCX, ODT, and Markdown files. All Lens endpoints follow the standard tools job workflow: upload a file, create a job, poll for completion, read the result.

Endpoints

Supported file types

All Lens endpoints accept the following file types:

Limits


OCR

Extract text from a document. Returns the document content as Markdown.

Output formats

The mdd and json output formats are only available for PDF files. For DOCX, ODT, and Markdown files, use md.

Page selection

For PDF files with md output format, you can optionally select specific pages using the pages parameter:
Page spec syntax:
  • "3" — single page
  • "2-5" — page range (inclusive)
  • "10-" — from page 10 to end
If pages is omitted, all pages are processed.

Example request

Example result

Cost

Plain md output costs 2 credits per processed page. Document recovery to mdd or json costs 18 credits per processed page. For DOCX, ODT, and Markdown files, plain Markdown extraction is counted as one page.

Generate Filename

Generate a structured filename for a document based on a naming schema with placeholders. The AI reads the document and fills in the placeholder values.

Request

Example result

If a placeholder value cannot be found in the document, it is replaced with unknown.

Cost

6 credits per request. For PDFs, only the first three pages are sent to OCR.

Classify

Classify a document into one of the provided categories. The AI reads the first 3 pages of the document and picks the best matching category.

Request

Example result

Result fields

Edge cases

  • Empty document: Returns the first category with confidence: 0 and a message indicating the document is empty.
  • No clear match: The closest category is returned with a low confidence score.
  • The AI will never invent new categories — it always picks from the provided list.

Cost

6 credits per request. For PDFs, only the first three pages are sent to OCR.

Extract

Extract structured data from a document based on a user-defined field schema. Define field names, types, and optional descriptions. The AI reads the document and returns a JSON object with the extracted values.

Request

Field types

Adding a description to a field helps the AI understand what to look for and significantly improves extraction accuracy.

Example result

Result fields

Edge cases

  • Field not found: The field is set to null and its name is added to fieldsMissing.
  • Empty document: All fields are returned as null and all field names appear in fieldsMissing.
  • PDF exceeds 50 pages: Only the first 50 pages are processed when no pages parameter is specified.

Cost

14 credits per page processed. For DOCX, ODT, and Markdown files, cost is 14 credits (counted as one page).

General workflow

All Lens endpoints follow the same async job pattern:

1. Upload the document

2. Create a Lens job

3. Poll for completion

Poll until status is COMPLETED or FAILED. Alternatively, use a webhook to receive a notification when the job finishes.

4. Read the result

The result is returned directly in the job response under the result field — there is no separate file to download. This applies to all Lens endpoints.
Unlike PDF tool jobs (merge, split, etc.), Lens jobs return structured data in the result field instead of producing an output file. You do not need to call the download endpoint.