Skip to content
SupportLogin
Estimate credit cost for document preprocessing

Estimate credit cost for document preprocessing

GET/api/v1/datasets/{dataset_id}/preprocessing-credits

Quotes the credits that extracting a document dataset (pdf, docx, pptx, xlsx, html, or a zip of them) will reserve, from the page count of each document. Pass the same pages_to_process or documents_to_process you intend to launch with. Page counting runs in the background after upload, so isFinal: false means the quote is still partial — poll until it is true. Start extraction with POST /datasets/{dataset_id}/launch-preprocessing.

Path ParametersExpand Collapse
dataset_id: string
Query ParametersExpand Collapse
pages_to_process: optional number

Maximum number of pages to process. Documents are included until this budget is reached. If omitted, all pages are processed.

minimum1
documents_to_process: optional number

Maximum number of documents to process. If omitted, all documents are processed.

minimum1
ReturnsExpand Collapse
availableCredits: number

User’s total available credits (team balance)

extractionCost: number

Estimated or actual credit cost for document extraction

totalPages: number

Total pages across all documents (sum of page counts)

totalDocuments: number

Total documents in the dataset

completedDocuments: number

Number of documents with completed extraction (page counts known)

isFinal: boolean

Whether the cost is final (all extractions complete) or an estimate

insufficientCredits: optional object { creditsRequired, creditsAvailable }

Present when available credits are insufficient for the extraction cost

creditsRequired: number

Credits the extraction would reserve

creditsAvailable: number

Credits available to the team

Estimate credit cost for document preprocessing

curl https://api.prod.adaptionlabs.ai/api/v1/datasets/$DATASET_ID/preprocessing-credits \
    -H "Authorization: Bearer $ADAPTION_API_KEY"
{
  "availableCredits": 0,
  "extractionCost": 0,
  "totalPages": 0,
  "totalDocuments": 0,
  "completedDocuments": 0,
  "isFinal": true,
  "insufficientCredits": {
    "creditsRequired": 0,
    "creditsAvailable": 0
  }
}
Returns Examples
{
  "availableCredits": 0,
  "extractionCost": 0,
  "totalPages": 0,
  "totalDocuments": 0,
  "completedDocuments": 0,
  "isFinal": true,
  "insufficientCredits": {
    "creditsRequired": 0,
    "creditsAvailable": 0
  }
}