# Read and parse
Source: https://docs.file.ai/ingest/ocr-models

> Choose the AI OCR model that reads your files, and read back the text it found on each page.

fileScout

# Read and parse

Copy pageCopy page

Choose the AI OCR model that reads your files, and read back the text it found on each page.

Copy pageCopy page

## 

[​

](#what-it-does)

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)

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)

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](/verify/file-intelligence).

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)

Try it

Read the page text of a processed file:

cURL

Python

Node.js

```
curl "$FILEAI_BASE_URL/files/<fileId>/ocr" \
  -H "x-api-key: $FILEAI_API_KEY"
```

```
import os, requests

BASE = "https://api.orion.file.ai/prod/v1"
HEADERS = {"x-api-key": os.environ["FILEAI_API_KEY"]}

ocr = requests.get(f"{BASE}/files/{file_id}/ocr", headers=HEADERS).json()
for page in ocr["ocr"]:
    print(page["page_number"], page["text"][:80])
```

```
const BASE = "https://api.orion.file.ai/prod/v1";
const headers = { "x-api-key": process.env.FILEAI_API_KEY };

const ocr = await fetch(`${BASE}/files/${fileId}/ocr`, { headers }).then((r) => r.json());
for (const page of ocr.ocr) console.log(page.page_number, page.text.slice(0, 80));
```

## 

[​

](#understand-the-result)

Understand the result

Response (200)

```
{
  "ocr": [
    { "page_number": 1, "text": "OCR Result page 1 example" },
    { "page_number": 2, "text": "OCR Result page 2 example" }
  ]
}
```

Field

Meaning

`ocr[]`

One entry per page.

`ocr[].page_number`

The page the text came from.

`ocr[].text`

The page’s text as plain text.

The response is plain text per page only. It has no layout, bounding boxes or coordinates.

A `fileId` that is blank or not found in your project returns `422` with `Invalid fileId.`

## 

[​

](#next-steps)

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)

Reference

### 

[​

](#how-the-model-is-chosen)

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](/verify/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)

Available models

Model name

Use it for

`Beethoven_ENG_O5.6`

English documents (OpenAI v6).

`Beethoven_ENG_G5.5`

English documents (Gemini v5).

`Beethoven_ENG_GP25`

English documents (Gemini Pro 2.5).

`Beethoven_ENG_GP25.1`

English documents (Gemini Pro 2.5 v1).

`Beethoven_ENG_GP25.2`

English PDFs (Gemini Pro 2.5 PDF). The default unless your project is configured otherwise.

`Unified (google-document-ai-ocr-gemini-v10)`

Unified model.

`Aegis (google-document-ai-ocr-gemini-aegis-v1)`

Aegis model.

`Beethoven_Direct_Form_Filling (GP2.5)`

Gemini Pro 2.5 OCR with direct form filling turned on for your project.

`Beethoven_CUS_O5.1`

Custom model (OpenAI v8).

`Beethoven_CUS_O5.2`

Custom model (Gemini v13).

`Beethoven_CUS_GP25.1`

Custom model (Gemini Pro 2.5).

`Beethoven_ZH_O5.9`

Chinese documents (OpenAI v9).

`Beethoven_JP_O5.3`

Japanese documents (OpenAI v3).

`Beethoven_JP_G5.4`

Japanese documents (Gemini, fine-tuned).

`Beethoven_TH_O5.1`

Thai documents (OpenAI v1).

`Beethoven_TH_G5.1`

Thai documents (Gemini v1).

`Capybara (Experimental)`

Experimental model. Also accepted as `capybara`. Only for projects set up for it. See [Experimental model](#experimental-model).

### 

[​

](#experimental-model)

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)

Retired models

Models that are no longer offered return `422` when you send them, on uploads and on `PATCH /v1/project/setting`:

```
{ "status": 422, "detail": "OCR model 'Beethoven_ENG_GP3' has been retired." }
```

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)

Override the model for one upload

```
curl -X POST "$FILEAI_BASE_URL/files/upload" \
  -H "x-api-key: $FILEAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fileName": "invoice-jp.pdf",
    "fileType": "application/pdf",
    "ocrModel": "Beethoven_JP_G5.4"
  }'
```

### 

[​

](#change-the-project-default)

Change the project default

The project default model is set in the app or with `PATCH /v1/project/setting`. See [File intelligence](/verify/file-intelligence). New defaults apply to files processed after the change.

[Previous](/ingest/supported-files)[

Extract fields

Define the fields fileAI extracts from each kind of document, then read and correct the values over the API.

Next

](/extract/ai-schemas)

⌘I

## On this page

*   [What it does](#what-it-does)
*   [When to use it](#when-to-use-it)
*   [How it works](#how-it-works)
*   [Try it](#try-it)
*   [Understand the result](#understand-the-result)
*   [Next steps](#next-steps)
*   [Reference](#reference)
    *   [How the model is chosen](#how-the-model-is-chosen)
    *   [Available models](#available-models)
    *   [Experimental model](#experimental-model)
    *   [Retired models](#retired-models)
    *   [Override the model for one upload](#override-the-model-for-one-upload)
    *   [Change the project default](#change-the-project-default)
