> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Box AI limits and pricing for document extraction

> Page, file, and prompt limits for the Box AI API, the file types one extraction API handles (scanned PDFs, photos, Word, and spreadsheets), and how AI Units pricing works for Ask and Extract.

The Box AI API runs on files stored in Box. This page collects the limits, supported file types, and AI Units pricing that decide whether a document workload fits, from a single 300-page agreement to millions of archived forms.

## Limits at a glance

| Constraint | Limit |
| - | - |
| Prompt length | 10,000 characters |
| Text per file (`single_item_qa`) | 2 MB of text. Content beyond 2 MB is truncated. |
| Files per request for `ask` (`multiple_item_qa`) | Up to 25 |
| Files per request for `extract` and `extract_structured` | Up to 25, processed together into one combined answer |
| Files per request for `text_gen` | Exactly 1 |
| Image resolution | 1024 x 1024 pixels |
| Images or image pages per request for `ask` | 5. If more are provided, only the first 5 are processed. |

Exceeding most limits does not return an error. Box truncates the input to the limit and processes what it can. For details, see input limits.

Box AI uses large language models, so the page guidance on this page is an estimate. Results vary with the density and content of each document.

## Can Box AI extract from a 300-page document without splitting it?

Sometimes. Whether an extraction completes depends on the token limit for processing, not the page count. A sparse 300-page document can complete in one call, while a dense 48-page brochure might not. For reliable results, split long documents into segments of about 50 pages.

Box offers two agents for `POST /ai/extract_structured`:

* **Standard Extract Agent:** recommended for high-volume, structured or semi-structured documents with 50 pages or fewer and fewer than 20 extraction fields.
* **Enhanced Extract Agent:** recommended for complex, large, or unstructured documents with 50 pages or more and more than 20 extraction fields, such as contracts or clinical reports.

To use the Enhanced Extract Agent, add the `ai_agent` object to your request:

```json theme={null}
{
  "ai_agent": {
    "type": "ai_agent_id",
    "id": "enhanced_extract_agent"
  }
}
```

See Enhanced Extract Agent and the Enhanced Extract Agent quick start.

### Scanned documents and the page limit

`extract_structured` applies additional processing to scanned documents, including automatic OCR and layout parsing, before extraction. For long scanned documents, see [Recommended approach for long agreements](#recommended-approach-for-long-agreements).

### Recommended approach for long agreements

For a long scanned document, such as a 300-page credit agreement:

1. Split the document into segments of about 50 pages, and upload each segment to Box as a separate file.
2. Call `extract_structured` on each segment with the Enhanced Extract Agent.
3. Combine the results from each segment in your application.

## One API for scanned PDFs, photos, and Word files

`POST /ai/extract_structured` accepts images, scanned documents, Office and Google files, PDFs, spreadsheets, and code or text files. You pass each file by its Box file ID in the `items` array. Box applies optical character recognition (OCR) automatically to images and scanned documents, so you do not need to convert photos to PDF or run a separate OCR step.

| File category | Examples |
| - | - |
| Images | jpeg, jpg, png, heic, tiff, webp, bmp, gif, dicom |
| Documents | pdf, doc, docx, gdoc, odt, pages, rtf, msg, boxnote |
| Presentations | ppt, pptx, key, gslides, odp |
| Spreadsheets | xls, xlsx, xlsm, csv, tsv, gsheet, numbers, ods |
| Design and CAD | ai, dwg, eps, psd |

For the full list, see supported file formats for structured extraction.

### Documents that mix text and scanned pages

The Enhanced Extract Agent supports PDFs that mix text pages and scanned pages. Extraction quality is typically lower than for documents where every page contains text.

### OCR by endpoint

Not every endpoint applies OCR. Use `extract_structured` for scanned documents and photos.

| Endpoint | OCR | Supported file formats |
| - | - | - |
| `POST /ai/extract_structured` | Yes (automatic) | Structured extraction formats |
| `POST /ai/extract` | No | Freeform extraction formats |
| `POST /ai/ask` | — | Ask formats |
| `POST /ai/text_gen` | No | Text-based files |

`extract_structured` has explicit multilingual support for English, Japanese, Chinese, Korean, and Cyrillic-based languages.

## Pricing and AI Units

Box AI API usage consumes AI Units. Each Box plan includes a monthly AI Unit allocation, and you can buy more.

| Plan | Included AI Units per month |
| - | - |
| Free developer plan | 1,000 |
| Business and Business Plus | Available for purchase |
| Enterprise | 1,000 |
| Enterprise Plus | 2,000 |
| Enterprise Advanced | 20,000 |

What consumes AI Units:

* **Box AI APIs:** All calls to the Box AI API, including Ask, text generation, and extraction, are chargeable.
* **Extraction through the Box MCP server:** Extraction tasks that an MCP tool runs use the API and consume AI Units.
* **Confidence scores and references:** Turning on confidence levels or bounding boxes consumes additional AI Units.
* **Premium models:** Choosing a premium model increases the rate of AI Unit consumption.

When your organization uses all of its AI Units, chargeable features, including the Box AI API, are blocked until the next entitlement period or until you buy more units. Admins can monitor consumption in the Admin Console. For plan details and chargeability rules, see [Understanding AI Units in Box](https://docs.box.com/en/box-ai/understanding-ai-units-in-box).

### Cost per request

AI Unit consumption per request depends on the endpoint, the agent and model tier, and whether you request confidence scores or references. For rates, see the [Box AI Units consumption table](https://cloud.box.com/v/box-ai-units-consumption-table).

## Extraction across millions of documents

There is no batch extract endpoint. Requests with several files return one combined answer, so for per-file results you call `extract_structured` once per file and run the requests concurrently:

1. Find the files with a webhook, by listing folder items, or from a Box Automate workflow.
2. Call `extract_structured` for each file ID with an identity that can access the file.
3. If the API returns `429 Too Many Requests`, wait for the time in the `Retry-After` header and retry. See rate limits.
4. Save each result on the file as a metadata instance.

Each call consumes AI Units, so the total cost of a backfill depends on the number of files, the agent, and whether you request confidence scores. See [Cost per request](#cost-per-request) and Run extraction across thousands of documents.

**RELATED GUIDES**
