What it does

An AI OCR model reads every page of an uploaded file and turns it into text that fileAI classifies and extracts from. You pick the model per upload, or rely on your project default, and read the page text back with GET /v1/files/{fileId}/ocr.

When to use it

  • You receive documents in Japanese, Chinese or Thai and need a model built for that language instead of the English default.
  • You need the raw text of each page, for example to index it for search or run your own parsing next to fileAI’s extraction.
  • You want every new file in a project read by a different model, without changing each upload request.

How it works

1

fileAI picks the model

If the upload request includes ocrModel, fileAI uses that model for the file. Otherwise it uses your project default.
2

The model reads each page

The text it finds is what fileAI classifies and extracts from.
3

You read the text

GET /v1/files/{fileId}/ocr returns the text of each page, using a fileId from the upload’s files[].

Try it

Read the page text of a processed file:

Understand the result

Response (200)
The response is plain text per page only. For text blocks, tables and their positions on the page, use GET /v1/files/{fileId}/layout (Capybara (Experimental) files only).
A fileId that is blank or not found in your project returns 422 with Invalid fileId.

Next steps

Uploads

Where to send ocrModel and the other upload fields.

Supported file types

The files each model can read.

Extract with AI Schemas

Turn the text into structured fields.

Reference

How the model is chosen

  1. If the upload request includes ocrModel, fileAI uses that model for the file.
  2. Otherwise fileAI uses your project default. Unless your project is configured otherwise, that is Beethoven_ENG_GP25.2. To change it, see File intelligence.
ocrModel is accepted on every upload route: POST /v1/files/upload, /files/upload/batch (per file or in defaults), /files/upload/multipart and /files/upload/multipart/batch. Send the model name exactly as listed below.

Available models

Experimental model

Capybara (Experimental) is available only to projects set up for it, in organizations where it is enabled. A per-upload ocrModel must match the project’s setup, or the request returns 422:
  • In a project not set up for it, capybara is rejected.
  • In a project set up for it, any other model is rejected. Omit ocrModel to use the project setting.

Retired models

Models that are no longer offered return 422 when you send them, on uploads and on PATCH /v1/project/setting:
Retired names include Beethoven_ENG_GP3, Beethoven_ENG_O5.1 to O5.5, Beethoven_ENG_G5.0 and G5.2 to G5.4, Beethoven_TH_O5.0, Beethoven_JP_O5.1, Beethoven_JP_O5.2 and Beethoven_JP_G5.1 to G5.3. A name that was never a model returns 422 with Invalid ocr model.

Override the model for one upload

Read the layout

GET /v1/files/{fileId}/layout returns each element the model found (paragraphs, tables and so on) with its text, its Markdown, its reading order and a bounding box. Use it to highlight a value on the page or to keep a document’s structure in your own parsing.
Layout is available only for files processed with the Capybara (Experimental) model (see Experimental model). For any other file, the endpoint returns 404 with File not found, even when the fileId is correct.
Illustrative: shape from the API reference.
Response (200)
  • pages and elements are filled only when status is ready. While it is pending, call again later.
  • bbox is [x0, y0, x1, y1], from 0 to 1, with the origin at the top-left of the page as displayed. Rotation is already applied. Multiply by the page’s width_pt and height_pt for points.
  • For a document split from a larger upload, pages holds only that document’s pages, numbered from 1. Element ids keep their page number in the whole upload, so p3.e9 can sit on page 1.
  • Table elements list their cells in cells, each with row, col, spans, text and its own bbox.
Every field: Get file layout.

Change the project default

The project default model is set in the app or with PATCH /v1/project/setting. See File intelligence. New defaults apply to files processed after the change.