ForHosting KIT · OCR & Data Extraction

Sort documents by type

Before a document can be extracted, archived, or approved, someone has to answer the boring first question: what kind of document is this? This endpoint reads an uploaded file and returns its most likely document type, so that question gets answered automatically, at the front of your pipeline, instead of by a person opening every attachment.

● StablePer request + per document$0.010
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

The sorting problem nobody wants to own

Shared inboxes and upload folders are chaos by nature: an invoice sits next to a driver's license, a lease sits next to a bank statement, and nothing about the filename tells you which is which. Someone, somewhere, is opening each file and deciding where it goes, and that someone does not scale past a few dozen documents a day. Document classification exists to replace that first triage step, the one that happens before any real extraction or approval logic can run, with a call that returns a type label in seconds instead of an inbox that gets stale by Friday.

What the endpoint actually returns

You call POST /ocr/document-classify, get a task_id back immediately, and the actual classification runs in the background since reading layout and content thoroughly takes longer than a synchronous request allows. When it finishes, you get the document's predicted type from a practical taxonomy such as invoice, contract, identification, bank statement, tax form, or receipt, along with a confidence signal so low-certainty cases can be routed to a human instead of silently misfiled. Delivery is your choice: a signed webhook the moment the result is ready, or a signed link you retrieve within 24 hours.

How it reads a document to decide

Classification looks at both layout and language: the grid of an invoice table, the numbered clauses of a contract, the photo and MRZ line of an identification document, the columnar structure of a bank statement. Document types have looked visually distinct for as long as institutions have standardized paperwork, which is precisely the signal this endpoint learns to read, rather than relying on filenames or folder conventions that are trivially wrong or missing. It handles native digital files and scanned paper equally, since the visual structure survives the scan even when the text layer does not.

Where it sits in an automated pipeline

Classification is almost always step one. A mortgage platform routes identification documents to a KYC check, bank statements to income verification, and everything else to manual review, all from a single classify call at intake. Downstream, teams commonly chain the result into a to-JSON extraction step configured per document type, since a contract and an invoice need entirely different fields pulled from them. Because it is stateless and billed per document, it works the same whether you call it on one upload from a web form or across a folder sync of ten thousand backlog files.

What it costs and why there is no free tier

Pricing is $0.010 per request plus $0.0575 per document classified, and you are never billed for a task that fails, we retry up to three times automatically before returning a clear, specific error. There is no free tier or trial: access requires prepaid balance, and calls without one return HTTP 402 immediately rather than queuing behind free-tier traffic. That tradeoff is intentional, it keeps response times predictable for everyone actually paying for throughput.

Shared intake inbox for a back office

A finance team's shared inbox auto-tags every incoming attachment as invoice, receipt, or statement before it ever reaches a human's queue.

Mortgage and lending document sets

A lending platform sorts a borrower's uploaded folder into identification, pay stubs, and bank statements to route each to the right verification step.

Legal document intake

A law firm's client portal separates contracts from correspondence and court filings automatically as clients upload files.

Insurance claims processing

An insurer classifies claim attachments as police reports, medical bills, or repair estimates before adjusters open the file.

What document types can the document classification API detect?

It covers a practical business taxonomy including invoices, contracts, identification documents, bank statements, tax forms, and receipts, with a confidence score returned alongside the label.

Does it work on scanned paper documents, not just digital PDFs?

Yes, it reads layout and visual structure, so scanned paper and native digital files are classified the same way.

Can I use it before extracting data from a document?

That is its most common use: classify first, then route each document type to a targeted extraction step so you pull the right fields for each kind of document.

Is there a free trial for document classification?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

How much does it cost to classify a batch of documents?

It is $0.010 per request plus $0.0575 per document, charged only for documents that are successfully classified.

What happens with low-confidence classifications?

The response includes a confidence signal, so you can route uncertain cases to manual review instead of trusting a low-confidence guess.

How do I retrieve the classification result?

You get a task_id right away, then the result via a signed webhook when ready or a signed link valid for 24 hours.

Can it classify thousands of documents in one batch?

Yes, each call is independent and billed per document, so it scales from a single upload to a large backlog without any change in how you call it.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/ocr/document-classify

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/ocr/document-classify \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"…"}'
{
  "input": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "ocr.document_classify",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.010
Per document$0.0575

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages10
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
422task_failedThe task failed after 3 retries. You are never charged for it.

Read the full KIT documentation →