---
title: "Estimate credit cost for document preprocessing"
method: GET
path: "/api/v1/datasets/{dataset_id}/preprocessing-credits"
tags: ["Dataset"]
---

# Estimate credit cost for document preprocessing

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

## Request

- The document declares no server URL.
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/adaptionlabs/apis/adaption-api/docs/api/v1/datasets/:dataset_id/preprocessing-credits/get.ts> (a function with typed inputs; its response is checked against the schema)

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 parameters

- `dataset_id` string, required

## Query parameters

- `pages_to_process` number
- `documents_to_process` number

## Response `200`

- PreprocessingCreditsResponseDto
  - `availableCredits` number, required: User's total available credits (team balance)
  - `extractionCost` number, required: Estimated or actual credit cost for document extraction
  - `totalPages` number, required: Total pages across all documents (sum of page counts)
  - `totalDocuments` number, required: Total documents in the dataset
  - `completedDocuments` number, required: Number of documents with completed extraction (page counts known)
  - `isFinal` boolean, required: Whether the cost is final (all extractions complete) or an estimate
  - `insufficientCredits` PreprocessingInsufficientCreditsDto
    - `creditsRequired` number, required: Credits the extraction would reserve
    - `creditsAvailable` number, required: Credits available to the team

## Other responses

- `400`: Not a document dataset, or both pages_to_process and documents_to_process were set.

## Changes

- **2026-11-03** `d4cf908c19a0`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/adaptionlabs/apis/adaption-api/changes/api/v1/datasets/:dataset_id/preprocessing-credits/get.md)

---

[API](https://skmtc.dev/adaptionlabs/apis/adaption-api.md) - [All operations](https://skmtc.dev/adaptionlabs/apis/adaption-api/llms.txt) - [OpenAPI document](https://skmtc.dev/adaptionlabs/apis/adaption-api/revisions/d4cf908c19a0?raw)
