01

What the API normalizes

A document upload is not useful merely because text came out. A production ingest layer needs stable page boundaries, reading order, headings, lists, tables, source metadata, warnings, and enough provenance to explain a bad result. DocParse returns readable Markdown for retrieval and model context alongside DocIR, a typed JSON representation of pages and blocks.

The same input contract accepts multipart uploads, raw binary uploads, and permitted HTTPS imports. Parser choice stays on the service side so a browser or untrusted caller cannot force a costly backend. The response records the chosen route and parser metadata instead of hiding the decision behind a generic success flag.

  • Markdown for chunking, search indexing, review, and prompt context.
  • DocIR JSON for pages, typed blocks, order, bounding boxes, and provenance.
  • A manifest for source identity, route decisions, versions, and warnings.
  • Lifecycle events for queued, running, retrying, succeeded, failed, canceled, and purged work.
02

Prototype inline, operate asynchronously

During integration, POST /v1/parse?wait=true returns the completed result for a normal document in one request. That keeps the first proof small: create a scoped key, send a representative file, inspect Markdown and DocIR, and decide whether the output is suitable before redesigning the surrounding pipeline.

When documents take longer or traffic grows, remove the wait flag. The API returns a job, and the same workload can be observed through polling, terminal webhooks, or lifecycle events. Idempotency keys prevent accidental duplicate work. Cancellation and purge provide explicit control over queued work and retained artifacts.

curl -X POST "https://docparse.genedai.me/v1/parse?wait=true" \
  -H "Authorization: Bearer $DOCPARSE_API_KEY" \
  -F "file=@document.pdf" -F "mode=both"
03

Production controls live beside parsing

Document infrastructure needs an access and cost boundary, not only a conversion function. DocParse hashes tenant API keys, applies scopes, enforces tenant quotas and concurrent admission, and records usage separately from the raw file. URL imports, outbound webhooks, and external OCR can be restricted per tenant.

The free workspace is intentionally deterministic and bounded: 20 text-based documents, 200 MB per month, one active job, and 20 MB per upload. Model-backed image and layout processing require an approved paid workspace. This lets a team validate the stable path without creating an open-ended model bill.

  • Hashed, named, scoped, revocable API keys.
  • Tenant-aware quotas, idempotency, concurrency, and usage events.
  • Signed terminal webhooks and host allowlists.
  • Source and artifact purge with retained-reference checks.

Frequently asked questions

Questions teams ask before building

What formats can the document parsing API accept?

The service routes PDFs, scans, PNG/JPEG/WebP images, DOCX, XLSX, PPTX, HTML, XML, CSV, and supported legacy Office files through format-appropriate paths.

Does the API return Markdown or JSON?

Both. Markdown is designed for readable downstream text; DocIR JSON preserves typed blocks, pages, layout, order, and provenance.

Can I start without building a job queue?

Yes. Use the wait=true request for an inline result, then move the same input to asynchronous jobs when latency or volume requires it.