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

# Parse Input Parameters

> Set the document, model version, and options when calling the Parse v2 API.

export const dpt3pro = 'DPT-3 Pro';

export const dpt3 = 'DPT-3';

export const parseDpt3 = 'Parse';

export const ade = 'Agentic Document Extraction';

Send input to the Parse v2 API as a POST request to `https://api.ade.landing.ai/v2/parse`. This page describes each request field.

## Sample Request

Send a document to the parse endpoint with a POST request. Replace `YOUR_API_KEY` with your [API key](./agentic-api-key) and `document.pdf` with the path to your file.

```bash theme={null}
curl -X POST 'https://api.ade.landing.ai/v2/parse' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'document=@document.pdf' \
  -F 'model=dpt-3-pro-latest' \
  -F 'options={"pages":[0]}'
```

## Parameters

| Parameter      | Required    | Description                                                                                                  |
| -------------- | ----------- | ------------------------------------------------------------------------------------------------------------ |
| `document`     | Conditional | The document to parse (PDF or image), sent as an uploaded file. Provide either `document` or `document_url`. |
| `document_url` | Conditional | A public URL that the API fetches the document from. Provide either `document` or `document_url`.            |
| `model`        | No          | The parsing model version. Defaults to the latest snapshot. See [Model Version](#model-version).             |
| `options`      | No          | A JSON object of optional settings. See [Request Options](#request-options).                                 |

## Model Version

{dpt3pro} is the current version of {dpt3}. By default, requests use the latest {dpt3pro} snapshot. To pin to a specific snapshot, supply it in the `model` form field on the request. The resolved version is returned in `metadata.model_version`.

Use a `-latest` alias for development or when you want continuous improvements; pin to a dated snapshot for production workloads where consistent results matter. Accepted values:

| Value                | Behavior                                                       |
| -------------------- | -------------------------------------------------------------- |
| `dpt-3-pro-latest`   | The latest snapshot of DPT-3 Pro. This is the default.         |
| `dpt-3-pro`          | Alias for `dpt-3-pro-latest`; resolves to the latest snapshot. |
| `dpt-3-pro-20260710` | The snapshot of DPT-3 Pro generated on July 10, 2026.          |

<Info>
  Some snapshots have been superseded: a newer snapshot replaced them, and they no longer appear in the table above. If you pin a superseded snapshot, your requests still succeed. The API resolves the name to the current snapshot and reports the current version in `metadata.model_version`. Update pinned code to a value from the table.
</Info>

## Request Options

The optional `options` form field is a JSON object that customizes the response. All fields are optional; omitted fields take the defaults shown.

| Field                   | Type                     | Default  | Description                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------- | ------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pages`                 | `int[]`                  | `null`   | 0-indexed page indices to process. `null` processes all pages. Negative indices return HTTP 422; indices beyond `page_count` are silently ignored. Skipped pages are absent from `structure.children`, and the Markdown has no gap marker; check `structure.children[].page` to identify missing pages.                                                                                                          |
| `dpi`                   | `int`                    | `200`    | Resolution used to scale a PDF's point-based coordinates to pixels (`pixels = PDF points × dpi / 72`). Allowed range: 72 to 300. Higher values produce larger coordinate and page-dimension values. Has no effect on image inputs, whose coordinates are already pixels relative to the original upload.                                                                                                         |
| `blocks.<type>.caption` | `bool`                   | `true`   | Whether to include the block type's content in the Markdown. Applies to `text`, `table`, `figure`, `marginalia`, `attestation`, `logo`, `scan_code`, and `card`. When `false`, visual types (`figure`, `logo`, `scan_code`, `card`, `attestation`) emit only a header line such as `> [!FIGURE]`; `text`, `table`, and `marginalia` emit nothing. Suppressed blocks still appear in `structure` and `grounding`. |
| `blocks.table.format`   | `"markdown"` or `"html"` | `"html"` | Table representation in the Markdown output. HTML preserves merged cells that pipe syntax cannot; `markdown` uses pipe syntax.                                                                                                                                                                                                                                                                                   |
| `grounding.parts`       | `bool`                   | `true`   | Whether to include the fine-grained `parts` array in each block's grounding node. Set `false` to omit.                                                                                                                                                                                                                                                                                                           |

### Example Options

The following examples all parse the same <a href="/examples/options/calibration-report.pdf" download="calibration-report.pdf">sample calibration report</a>, so you can see exactly what each option changes.

For the complete, unmodified output, download the <a href="/examples/options/response-no-options.json" download="response-no-options.json">full default response</a> (parsed with no options).

Each example shows the full request with the relevant `options` line highlighted, followed by a trimmed response.

#### Process Specific Pages

Pass `pages` to parse only the pages you need. `metadata.page_count` still reports the full document length, while `structure.children` returns only the requested pages.

```bash highlight={5} theme={null}
curl -X POST 'https://api.ade.landing.ai/v2/parse' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'document=@calibration-report.pdf' \
  -F 'model=dpt-3-pro-latest' \
  -F 'options={"pages":[0,2]}'
```

The response counts all pages in `page_count` but returns only pages 0 and 2 in `structure.children`:

```json theme={null}
{
  "metadata": {
    "page_count": 3,
    "failed_pages": []
    // ...
  },
  "structure": {
    "type": "document",
    "children": [
      { "type": "page", "page": 0, "span": [0, 1695], "status": "ok", "children": [ /* ... */ ] },
      { "type": "page", "page": 2, "span": [1716, 3224], "status": "ok", "children": [ /* ... */ ] }
    ]
  }
}
```

#### Render Tables as Markdown

Tables are returned as HTML by default. HTML preserves merged cells and nested layouts that pipe syntax cannot represent, such as the `Measured Value` header spanning the `As Found` and `As Left` columns in this calibration table:

```html theme={null}
<table>
<tr><td rowspan="2">Test Point</td><td rowspan="2">Nominal (V)</td><td colspan="2">Measured Value (V)</td><td rowspan="2">As-Found Deviation (mV)</td><td rowspan="2">Tolerance (±mV)</td><td rowspan="2">Result</td></tr>
<tr><td>As Found</td><td>As Left</td></tr>
<tr><td>TP-1</td><td>0.000</td><td>0.001</td><td>0.000</td><td>+1</td><td>5</td><td>Pass</td></tr>
<tr><td>TP-2</td><td>2.500</td><td>2.503</td><td>2.500</td><td>+3</td><td>10</td><td>Pass</td></tr>
<tr><td>TP-3</td><td>5.000</td><td>5.041</td><td>5.002</td><td>+41</td><td>20</td><td>Fail</td></tr>
<tr><td>TP-4</td><td>7.500</td><td>7.512</td><td>7.503</td><td>+12</td><td>30</td><td>Pass</td></tr>
<tr><td>TP-5</td><td>10.000</td><td>10.018</td><td>10.004</td><td>+18</td><td>40</td><td>Pass</td></tr>
</table>
```

Set `blocks.table.format` to `markdown` to receive tables as pipe-syntax Markdown instead. Merged cells expand into empty adjacent cells:

```bash highlight={5} theme={null}
curl -X POST 'https://api.ade.landing.ai/v2/parse' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'document=@calibration-report.pdf' \
  -F 'model=dpt-3-pro-latest' \
  -F 'options={"blocks":{"table":{"format":"markdown"}}}'
```

The `markdown` field returns the same table using pipe syntax, with the merged header flattened into empty cells:

```markdown theme={null}
| Test Point | Nominal (V) | Measured Value (V) |  | As-Found Deviation (mV) | Tolerance (±mV) | Result |
|---|---|---|---|---|---|---|
|  |  | As Found | As Left |  |  |  |
| TP-1 | 0.000 | 0.001 | 0.000 | +1 | 5 | Pass |
| TP-2 | 2.500 | 2.503 | 2.500 | +3 | 10 | Pass |
| TP-3 | 5.000 | 5.041 | 5.002 | +41 | 20 | Fail |
| TP-4 | 7.500 | 7.512 | 7.503 | +12 | 30 | Pass |
| TP-5 | 10.000 | 10.018 | 10.004 | +18 | 40 | Pass |
```

#### Suppress a Block Type

Set a block type's `caption` to `false` to drop its content from the `markdown`. Here, figures are suppressed, so each figure collapses to a `> [!FIGURE]` header line. The figure still appears in `structure` and `grounding`.

```bash highlight={5} theme={null}
curl -X POST 'https://api.ade.landing.ai/v2/parse' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'document=@calibration-report.pdf' \
  -F 'model=dpt-3-pro-latest' \
  -F 'options={"blocks":{"figure":{"caption":false}}}'
```

The `markdown` field shows each figure as a header line instead of a caption:

```markdown theme={null}
AS-FOUND DEVIATION BY TEST POINT

> [!FIGURE]
```

#### Omit Grounding Parts

Set `grounding.parts` to `false` to drop the fine-grained `parts` array from each block's grounding node, leaving only the block-level `box`. Use this to reduce response size when you don't need line-level coordinates.

```bash highlight={5} theme={null}
curl -X POST 'https://api.ade.landing.ai/v2/parse' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'document=@calibration-report.pdf' \
  -F 'model=dpt-3-pro-latest' \
  -F 'options={"grounding":{"parts":false}}'
```

Each block's grounding node returns an empty `parts` array:

```json theme={null}
{
  "type": "text",
  "id": "22",
  "span": [720, 1169],
  "box": [149, 804, 1534, 996],
  "parts": []
}
```
