Estimate credit cost for document preprocessing
Estimate credit cost for document preprocessing
datasets.get_preprocessing_credits(strdataset_id, DatasetGetPreprocessingCreditsParams**kwargs) -> DatasetGetPreprocessingCreditsResponse
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.
Estimate credit cost for document preprocessing
import os
from adaption import Adaption
client = Adaption(
api_key=os.environ.get("ADAPTION_API_KEY"), # This is the default and can be omitted
)
response = client.datasets.get_preprocessing_credits(
dataset_id="dataset_id",
)
print(response.available_credits){
"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
}
}