DocInspect API

File. Prompt. JSON schema.
Response: structured data.

POST /v1/task takes an invoice, a contract or a scan and returns clean JSON matching your schema. Personal data is scrubbed before any LLM.

СЧЁТ № 214от 3 июля 2026 г.ПОСТАВЩИКООО «Стальпро»ИНН 7714563210 / КПП 771401001ПОКУПАТЕЛЬООО «Балтийский склад»ИНН 7805419372НАИМЕНОВАНИЕКОЛ-ВОСУММАСтеллаж СТ-120012214 800,00Тележка гидравлическая3187 560,00Итого: 402 360,00 ₽В т.ч. НДС 20 %: 67 060,00 ₽РуководительООО «СТАЛЬПРО»г. МоскваСчёт действителен до 17.07.2026
POST/v1/task
POST /v1/task200 OK
{
"result": {
"supplier": { "name": "ООО «Стальпро»", "inn": "7714563210" },
"invoice_number": "214",
"invoice_date": "2026-07-03",
"items": [
{ "name": "Стеллаж СТ-1200", "qty": 12, "amount": 214800.00 },
{ "name": "Тележка гидравлическая", "qty": 3, "amount": 187560.00 }
],
"total_amount": 402360.00,
"vat_amount": 67060.00
},
"anonymization": { "mode": "fail_closed", "items": 6 },
"pages_processed": 1,
"tokens_used": 1218
}

Your first call, on your stack

curl -X POST https://api.docinspect.ru/v1/task \
-H "X-API-Key: $DOCINSPECT_API_KEY" \
-F "file=@invoice.pdf" \
-F "prompt=Extract the invoice fields" \
-F 'output_schema={
"type": "object",
"properties": {
"supplier": {"type": "object", "properties": {
"name": {"type": "string"}, "inn": {"type": "string"}}},
"total_amount": {"type": "number"}
}
}'

One endpoint. The whole document pipeline.

POST /v1/task takes a file and runs it through the pipeline: splitting, recognition, schema extraction, embeddings. One contract instead of four integrations.

POST/v1/task

Describe the task in words

A file, a prompt and a response schema. Classification, extraction, version diffing and risk analysis are different prompts, not different endpoints.

stageextract

Extraction against a JSON schema

Every field arrives with a confidence score. A broken tax ID or mismatched totals get flagged with a warning before you notice.

stagesplit

One PDF, 14 documents inside

Document boundaries in a multi-file are detected without an LLM. Output: separate documents with their types, each continues down the pipeline.

stageembed

Embeddings for your search

A 256-dimension vector for any text. Semantic search over a document archive without your own ML.

Our own engine reads structure, not just text

The core of the API is built from scratch: the engine reconstructs a document as structure. Tables, merged cells, row-and-column links, the contents of every field. This is exactly where generic recognizers break.

ВЕДОМОСТЬ МАТЕРИАЛОВНаименованиеКол.Ед.Масса, кгЛист горячекатаный12шт.96,4Швеллер 12П8м74,26м55,6Итого по разделу226,2rowspan 2colspan 3
structure
{
  "rows": 5, "cols": 4,
  "merges": [
    { "r": 2, "c": 0, "rowspan": 2,
      "text": "Channel 12P" },
    { "r": 4, "c": 0, "colspan": 3,
      "text": "Section total" }
  ],
  "cells": 17
}

Tables and merged cells

Merges, headers and boundaries come back as a precise grid, not as a stream of text.

Links and contents

Every cell knows its row, column and value: the data is ready for reconciliation and accounting import.

A closed core

Built in-house under a closed license, not a wrapper around off-the-shelf libraries. Quality does not depend on someone else's releases.

Cyrillic from scans. Tables survive.

An in-house OCR loop tuned for Cyrillic, with a fallback recognizer for difficult scans. Scans, photos and tables become clean markdown with rows and columns intact.

Formats: PDF, DOCX, XLSX, JPG, PNG, WebP, TIFF. Limit: 50 MB.

A bad scan never fails silently: input_quality_score tells you when to ask for a retake.

markdown
| Item              |     Amount |
|-------------------|-----------:|
| Rack ST-1200      | 214,800.00 |
| Hydraulic trolley | 187,560.00 |

Personal data never reaches the external LLM

Before every external call the NDA boundary scrubs out company names, tax IDs, people and addresses. The model works on placeholders; real values are restored locally in the response.

your document

Contract party
ООО «Стальпро»
Tax ID (INN)
7714563210
Signatory
A. V. Kozintseva
Address
Moscow, Skladochnaya 3

what the external LLM sees

Contract party
{ORG_1}
Tax ID (INN)
{INN_1}
Signatory
{PERSON_1}
Address
{ADDR_1}

422 ANONYMIZATION_INCOMPLETE

fail_closed mode

If the scrubber cannot guarantee a clean payload, the request simply does not leave. You get a 422 with category counters, not a leak.

152-ФЗ

An argument for your security team

De-identification happens before any third party sees the data: the compliance requirement is closed by architecture, not by a clause in a contract.

A drawing in. A bill of materials out.

The API reads a framed sheet with a title block: item numbers, designations, materials and quantities become a BOM table matching your schema. One call instead of retyping into a spreadsheet.

Works on a stack of sheets too: async_mode walks a whole drawing set in a single request.

A 91-page contract: one call

async_mode=true returns a task_id instantly, then you poll as usual. No proxy timeouts on long scans, no manual file slicing.

async polling
POST /v1/task            async_mode=true
  202 { "task_id": "9f3c41", "poll_url": "/v1/task/9f3c41" }

GET /v1/task/9f3c41
  { "status": "processing" }

GET /v1/task/9f3c41
  { "status": "done", "pages_processed": 91, "result": { … } }

Under the hood: a five-model fallback cascade that accumulates results. If a provider goes down mid-task, the next model picks up from the same spot, and the task survives to the answer.

What gets automated first

Three scenarios teams usually start with. The figures are benchmarks for a typical scenario, not customer statistics: yours depend on your document flow.

40 min → 2 min

per batch of documents

Primary document entry

/v1/split → /v1/task

Invoices, delivery notes and receipts from email arrive in your accounting system as ready JSON. An operator reviews low-confidence fields instead of retyping the document.

before payment

not at the quarter-end reconciliation

Invoices checked against the contract

warnings[] in the response

Amounts, requisites and line items are compared with the contract terms in a single prompt. A mismatch arrives as a warning right in the API response.

1 call

instead of retyping into a spreadsheet

Drawing → bill of materials

async_mode=true

A set of drawings becomes BOM tables matching your schema: item numbers, designations, materials and quantities arrive already structured.

You know the price before the first call

1 page = 2,000 characters of recognized text. We count text, not PDF sheets.

Estimate with the calculator

Try it free: your first 100 pagesAn API key right after sign-up. Pick a plan later, once you know your volume.

Starter

$59/mo

early-access pricing

5,000 pages per month

$0.012 per page

Business

$399/mo

early-access pricing

50,000 pages per month

$0.008 per page

Enterprise

custom

volume to match your load

On-premise, self-hosted LLM, SLA

Three steps to your first JSON

  1. Get a key

    Sign up in the dashboard. The key works immediately, 100 pages per month are free.

  2. Send a document

    One multipart request: file, prompt and response schema.

    curl -X POST https://api.docinspect.ru/v1/task \
      -H "X-API-Key: $KEY" -F "file=@invoice.pdf" \
      -F "prompt=Extract the invoice fields"
  3. Parse the response

    result matches your output_schema. Long documents: async_mode, batches: /v1/split.