/// EXTRACT
2 credits

PDF Classify API — label a document with your own categories

Give it your own label set; get back the best match, a confidence score, and low-confidence routing to human review.

/// Quick answer

Classify sends the text of the pages you choose (pages: "all", "first", or an explicit page list) to an LLM against a label set you define — each label just needs a name and a short description, at least two and up to a practical cap. The response returns the best-matching label and a confidence score; anything below the confidence threshold is flagged needs_review and handed to the same review queue the schema-extraction tools use, rather than silently returned as a guess. A scanned page with no text layer is OCR'd first automatically, at extra cost reflected in the response.

Try PDF Classify API — free →Read the docs

Free account. No card required.

How does the PDF Classify API work?

One HTTP request from any language. Every ASHDOCS endpoint uses the same X-API-Key header.

curl -X POST https://www.ashdocs.com/api/v2/tools/pdf-classify \
  -H "X-API-Key: ash_live_..." \
  -F "file=@document.pdf" \
  -F 'options={"labels":[{"name":"invoice","description":"A bill for goods or services"},{"name":"contract","description":"A signed agreement between parties"}]}'

Common use cases

Frequently asked questions

What do I send to classify a PDF?+

The PDF and your own label set: 2 to 20 labels, each with a unique name and an optional short description. You can also choose the pages: all (the default), the first, or a list of page numbers.

What happens when the model isn't sure?+

Every result comes back with a confidence score. A result below the threshold (0.85 by default) is also marked for review in the same queue the extraction tools use, so a person can check it.

Does it work on scanned pages?+

Yes. When the pages you classify have no text layer, the PDF is OCR'd first and the OCR's 3 credits are added, shown as ocr_credits in the response. Otherwise classifying costs 2 credits with a live key.

RELATED TOOLS